-
1. Re: setRollbackOnly() not rolling back completely
jaikiran Aug 24, 2010 11:47 PM (in response to marnold)Do you use a transaction aware resource like a datasource to communicate with the DB? Plain JDBC statements will not be enrolled in the transaction.
-
2. Re: setRollbackOnly() not rolling back completely
marnold Aug 25, 2010 5:01 AM (in response to jaikiran)jaikiran pai wrote:
Do you use a transaction aware resource like a datasource to communicate with the DB? Plain JDBC statements will not be enrolled in the transaction.
Yes, I am using a transaction aware DataSource. I configured it along the lines of this Wiki: http://community.jboss.org/wiki/SetupAOracleDataSource. (I've tried both local TX and XA datasources.)
I have JMS and JDBC transactions commiting and rolling back together successfully using a container managed transaction where both the JMS and JDBC work are performed by a single session bean.
The difference is that here the JDBC work is performed in a session bean and the JMS work performed implicitly by an MDB. I have @TransactionAttribute(TransactionAttributeType.REQUIRED) on the session bean so my understanding is that it will perform its work in the same transaction as the MDB onMessage().
Regardless of whether the session bean uses a separate transaction as the MDB or not, I am calling setRollbackOnly() so I expect the JDBC work to be rolled back.... it's not.
-
3. Re: setRollbackOnly() not rolling back completely
marnold Aug 25, 2010 6:01 AM (in response to marnold)Hi everyone - please ignore this question. I am actually an idiot, and it's all working correctly. I got confused because my MDB was sent two messages - one worked and committed correctly - the other didn't and was rolled back correctly.
Sorry to everyone who took the time to read and consider my question.
-
4. Re: setRollbackOnly() not rolling back completely
jaikiran Aug 25, 2010 6:40 AM (in response to marnold)Thanks for posting those details here.
M Arnold wrote:
No problem, it happens to everyone