[jboss-user] [JCA/JBoss] - Re: Opening connection from a marked rollback tx
do-not-reply at jboss.com
Fri Nov 23 10:19:07 EST 2007
"oglueck" wrote : That makes sense. I don't know if I can reproduce the problem in a reasonably small test case. I can try, but I currently lack the time.
| // BMT bean
| public void recreateRandomRollbackOnly() throws Exception
| UserTransaction ut = ..
| ut.setTransactionTimeout(5); // 5 second timeout
| Thread.sleep(10000); // 10 second sleep
| catch (InterruptedException ignored)
| // Transaction has timed out here
| DataSource ds = ...;
| ds.getConnection().close(); // Oops can't enlist in dead transaction
anonymous wrote :
| RollbackException - Thrown to indicate that the transaction has been marked for rollback only.
| IllegalStateException - Thrown if the transaction in the target object is in the prepared state or the transaction is inactive.
If you need to do out-of-bound communication (i.e. read the database
even if the transaction has failed) then you need to use a different transaction,
either RequiresNew or no-tx-connection-manager.
There's nothing you can do in the dead transaction.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107375#4107375
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107375
More information about the jboss-user