[jboss-dev-forums] [Design of JBoss Transaction Services] - Re: Transaction Status.STATUS_ROLLEDBACK

jhalliday do-not-reply at jboss.com
Thu Jul 10 08:20:34 EDT 2008


> I get the impression that it is for some reason almost impossible for current implementation to mark the transaction into status NO_TRANSACTION in case of timeout. 

It's not impossible to implement, it's a clear design choice on our part that a timeout should not disassociate the business logic thread from the transaction context.  And by the way if it did you would still need just as much exception handling, since the tx.commit/tx.rollback calls would potentially throw IllegalState, there being no transaction to commit/rollback. You have to write the exception handling code either way so changing the design decision would not help you.

> could the implementation at least refrain from throwing the IllegalStateException if I rollback a transaction marked STATUS_ROLLEDBACK.

It could, but then we would get complaints from users who can no longer programatically distinguish timeout cases. In essence such a change in behaviour would cause the transaction manager to mask information that is actually useful for some users.

P.S. your finally block is not thread safe, since the tx status may change between your call to getStatus and your call to rollback.  Async rollback is fun, isn't it :-)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163585#4163585

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163585



More information about the jboss-dev-forums mailing list