[jboss-dev-forums] [JBoss Transactions Development] - Best way for ResourceManager to handle tx timeout

jmesnil do-not-reply at jboss.com
Tue Sep 29 04:18:27 EDT 2009


I am currently checking that HornetQ XAResource behave correctly wrt to transaction timeout.  There is a whole discussion about it (http://www.jboss.org/index.html?module=bb&op=viewtopic&t=144955) but I have some questions which are more general about how the TM and RM must cooperate.

If the RM accepts the transaction timeout set by the TM (XAResource.setTransactionTimeout() returns true) and rolls back a tx after the timeout, is it correct to return XA_ERRNOTA when the TM calls prepare() on the RM? Or MUST we return XA_RBTIMEOUT?
AIUI, returning XA_RBTIMEOUT gives the TM more contextual info but it will be handle the same way than XA_ERRNOTA. Is it the case for JBoss TS?

If we can return XAERR_NOTA, this means the RM can forget about the XID as soon as the tx timeout is hit. If we must return XA_RBTIMEOUT, it must keep the XID until the TM calls prepare().

Another question: Is there a real advantage for the RM to handle timeout?
The more I look at this issue for HornetQ, the less I am convinced we should handle tx timeout at all. It seems simpler to let the TM drive the whole thing.
The only issue I see with the RM not dealing with tx timeout is when the RM and TM runs in separate processes and the TM crashes.

wdyt?
jeff

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

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



More information about the jboss-dev-forums mailing list