[jboss-dev-forums] [Design of JBoss Transaction Services] - JBAS-5801 - Locking in 2PC

adrian@jboss.org do-not-reply at jboss.com
Mon Jul 28 06:28:41 EDT 2008


WRT: https://jira.jboss.org/jira/browse/JBAS-5801

It occurs to me that there might not actually be any need to do the locking
in the resource adapter during 2PC, i.e. prepare/commit/rollback?

What we really want to do is make sure that end() blocks 
at tx timeout until the current user operation has completed.

Is that correct?

e.g. The case would be:

User: Connection.createSession(); // allocates and enlists connection
JCA: XAResource.start();

Then later something like a competing

User: sendMessage(); 
TM: tx timeout => XAResource.end() before XAResource.rollback()

We basically don't want the sendMessage() to occur during or after
the rollback because that could potentially lead to inconsistencies
depending upon how the underlying jms determines what to do.

i.e. All we actually need to do is make sure the end() and sendMessage()
(or other user ops) aren't racing with other.

If true that would make the fix for 5801 a lot simpler since we could just
remove the unnecessary locking in 2PC callbacks.

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

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



More information about the jboss-dev-forums mailing list