[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: XA resource and setting the timeout

jhalliday do-not-reply at jboss.com
Wed Nov 5 06:21:58 EST 2008


> You're saying we should only timeout unprepared txs? If so, why? 

Let's go back to my quote from the XA spec:

"An RM can mark a transaction branch as rollback-only any time except after a successful prepare. ...An RM can also unilaterally roll back and forget a branch any time except after a successful prepare."

Timeouts allow an RM to walk away from an unprepared tx that it thinks may have been abandoned. It's useful to cover e.g. client crashes. It does not lead to an inconsistent tx outcome since the tx is presumed abort at that stage anyhow.

Unilaterally deciding to rollback a prepared branch is a much bigger deal as it can lead to heuristics. It can be done, but needs a lot more thought and logging.

Personally I'd avoid automating post-prepare rollbacks and instead provide a tool that admins can use to manually force a tx outcome. Since it may lead to data inconsistency it's not a decision to me made lightly and the best course of action usually needs some understanding of the business context e.g. in some cases it's better to stay blocked for consistency, whilst in others availability concerns may make a rollback+manual data reconciliation a more attractive option.

> No, we just include prepared txs

ok, that's fine. Some systems will include the unprepared ones too, on the basis that the tx manager will rollback any it does not recognise, which means they get cleaned up sooner than a timeout may achieve. It's not a common approach though.

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

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



More information about the jboss-dev-forums mailing list