problem with activiti transaction

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2013 09:13 AM
hi all,
This is how my code is,
@Transactional(readOnly = false, propagation = Propagation.REQUIRED,rollbackFor = {Exception.class} )
public void saveFile()
{
saveFile(uploadItem);
raiseAndcompeleteUploadTask(uploadItem);
saveDocumentHistory();
}
@Transactional(readOnly = false, propagation = Propagation.REQUIRED,rollbackFor = {Exception.class} )
void raiseAndcompeleteUploadTask(Document uploadItem) throws Exception
{
taskService.complete(taskId);
}
As you can see in the above code in the function raiseAndcompeleteUploadTask i am closing the activiti task, if something goes wrong after the call raiseAndcompeleteUploadTask() and in call saveDocumentHistory() whatever the database change happened in activiti tables not getting rolled back.
other functions such as saveFile() and saveDocumentHIstory() both are running in transaction mode readOnly= false and Propagation.REQUIRED
all the transactions should get rolled back, please help me to fix this issue.
with regards,
pavan bukka.
This is how my code is,
@Transactional(readOnly = false, propagation = Propagation.REQUIRED,rollbackFor = {Exception.class} )
public void saveFile()
{
saveFile(uploadItem);
raiseAndcompeleteUploadTask(uploadItem);
saveDocumentHistory();
}
@Transactional(readOnly = false, propagation = Propagation.REQUIRED,rollbackFor = {Exception.class} )
void raiseAndcompeleteUploadTask(Document uploadItem) throws Exception
{
taskService.complete(taskId);
}
As you can see in the above code in the function raiseAndcompeleteUploadTask i am closing the activiti task, if something goes wrong after the call raiseAndcompeleteUploadTask() and in call saveDocumentHistory() whatever the database change happened in activiti tables not getting rolled back.
other functions such as saveFile() and saveDocumentHIstory() both are running in transaction mode readOnly= false and Propagation.REQUIRED
all the transactions should get rolled back, please help me to fix this issue.
with regards,
pavan bukka.
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2013 10:09 AM
Make sure the transaction-manager used for activiti is the same as the one used in activiti… Are you using spring?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2013 01:44 AM
hi frederikheremans,
Thank you very much for your replay, i was actually using two transaction managers namely org.springframework.orm.hibernate3.HibernateTransactionManager and org.springframework.jdbc.datasource.DataSourceTransactionManager
now i changed it to use only org.springframework.orm.hibernate3.HibernateTransactionManager and then the problem got fixed.
Thank you very much for your replay, i was actually using two transaction managers namely org.springframework.orm.hibernate3.HibernateTransactionManager and org.springframework.jdbc.datasource.DataSourceTransactionManager
now i changed it to use only org.springframework.orm.hibernate3.HibernateTransactionManager and then the problem got fixed.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2013 03:50 AM
Great to hear your problem is fixed now.
