-
Jan 17th, 2012, 10:40 AM
#1
Problem while using @Transactional
Hello guys,
We experiment a problem with Spring @Transactional annotations.
We have a MDP marked as @Transactional(propagation = Propagation.REQUIRED).
In the onMessage method we call a BusinessService marked as @Transactional(propagation = Propagation.REQUIRED, rollbackFor = { MyException.class}).
When the BusinessService throws MyException, spring mark the JTA Transaction as rollbackOnly.
But when it is back to MDP it try to commit the transaction and we have the
org.springframework.transaction.UnexpectedRollback Exception: JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore .commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore .commitwhenaborted] Can't commit because the transaction is in aborted state
Is there a mean to use rollbackFor in a business service without having throwing exception when it is back to the main service ?
Thank you for your help.
-
Jan 18th, 2012, 01:20 AM
#2
it would be very difficult for anyone to give exact answer for your question, so i will suggest you to post with code snippets of your applicationContext.xml file and related Bean classes and methods, so one can go through code and can provide you the correct approach for your situation.....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules