Topics

Possibility of a 2PC optimisation?


Tom Jenkinson
 

We had a suggestion on our Narayana forum (https://developer.jboss.org/thread/277738) regarding an enhancement that avoids the prepare phase if only one resource actually made any changes. The problem is that during prepare processing - while we may know that in a given specific case only one resource will return XA_OK from prepare (the rest returning XA_RDONLY), it's only a matter of chance as to whether that particular resource will end up last in the list (and thus be eligible for 1PC optimization). 
 
The suggestion is to indicate, ahead of time, that the transaction branch did not do any work.
 
The end call would have been an ideal opportunity to report this information.

We would like to ask if, during the writing of the XA spec, anyone is aware of why XA_RDONLY was not considered to be a valid return value from the xa_end() call in order to support this possibility?


Tom Jenkinson
 

It seems there was a delay on the first message being delivered hence this is somewhat of a duplicate.

Let's discuss over on Mike's thread: https://javaee.groups.io/g/jta-spec/topic/suggestion_for_a_2pc/18102512?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,18102512