Re: [jboss-dev-forums] [JBoss Transactions Development] - Regression on setRollbackOnly
by Mark Little
Mark Little [http://community.jboss.org/people/mark.little%40jboss.com] replied to the discussion
"Regression on setRollbackOnly"
To view the discussion, visit: http://community.jboss.org/message/549196#549196
--------------------------------------------------------------
OK, so the reason we now throw InactiveTransactionException is because (as the JIRA states) IllegalStateException has a well defined meaning according to JTA "Thrown if the current thread is not associated with a transaction." In this case there is a transaction associated with the calling thread, it's just that it's no longer active. OTS correctly differentiates these cases, but once again JTA is broken in this regard ;)
So what we did was provide a new SystemException to try to allow for the differentiation in the case someone codes against our specific exceptions as well as those who don't care and only catch SystemExceptions (or not). I didn't like the idea of deriving from IllegalStateException because in the case of users who only catch that exception rather than, say, an InactiveTransactionException that is derived from ISE, their code may assume one thing (no transaction) when in fact that's not the case. At least with an exception derived from SE code cannot make any assumption about the thread-to-transaction association.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/549196#549196]
Start a new discussion in JBoss Transactions Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months