JBoss Community

Re: Remote Txn Inflow: Synchronizations

created by Tom Jenkinson in JBoss Transactions Development - View the full discussion

Hi David,

 

I don't think we reached an actual conclusion on this. The difficulty we have with synchronizations is when one is registered on the subordinate transaction manager we ideally need to be able to register this on the root transaction manager to ensure we get the ordering correct during completion.

 

For example:

 

Root TM

XA resource for DB1 used

Synchronization registered to flush SQL to DB1 during beforeCompletion

 

Txn flows to subordinate TM

XA resourec for DB1 used again

Synchronization registered to flush SQL to DB1 during beforeCompletion

 

Now during transaction completion if you don't have network aware synchronizations the sequence could be:

1. beforeCompletion sync on root TM flushes SQL to DB1

2. XA resource for DB1 prepares

3. before completion sync on sub TM flushes SQL to DB1 resulting in an error

 

To be able to work around this we need some mechanism for synchronizations registered on the subordinate TM to be called before the transaction completes which for performance reasons would probably mean we want to extend the TM somehow to support registering these with the root TM, though this would possibly mean that the JTA would become transport aware. Instead, we could use eager interposition and always register a "proxy synchronization" for each subordinate TM so that when the root TM runs through the list of synchronizations it will call back to each subordinate TM to do the beforeCompletion events, even if the subordinate TM does not have any synchronizations to do (apart from possibly to cascade these down).

 

Tom

 

PS It's really part of the other thread but we will possibly need a similar mechanism to register subordinate transaction managers as XAResources of the root TM in order to cascade recovery calls, I am still checking this out though.

Reply to this message by going to Community

Start a new discussion in JBoss Transactions Development at Community