Suggestion for a 2PC optimisation


Michael Musgrove
 

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. I would like to ask if, during the writing of the XA spec, why XA_RDONLY was not considered to be a valid return value from the xa_end() call.

Join jta-spec@javaee.groups.io to automatically receive all group messages.