cancel
Showing results for 
Search instead for 
Did you mean: 

problem with activiti transaction

pavan_bukka_ait
Champ in-the-making
Champ in-the-making
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.
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
Make sure the transaction-manager used for activiti is the same as the one used in activiti… Are you using spring?

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.

frederikherema1
Star Contributor
Star Contributor
Great to hear your problem is fixed now.