XAResource needs ordering guarantees for setReadOnly#244
XAResource needs ordering guarantees for setReadOnly#244njr-11 wants to merge 1 commit intojakartaee:masterfrom
Conversation
|
Can one of the admins verify this patch? |
|
OK to test |
|
@beikov - please can I ask you to review this too? It looks good to me but I think we should have a TCK test to verify it. @njr-11 I can help with the TCK if you like, or you could try to build on what @beikov provided before. It should be feasible to extend the XAResourceImpl (https://github.com/jakartaee/platform-tck/pull/2163/files#diff-9c52739a364cbdb85f1b41362ca714de2cecc5c06a95383e467f587bf2e18420R32) to check that start is called first |
|
LGTM |
@tomjenkinson that would be great if you add the TCK test. Thanks! My familiarity with Jakarta Transactions is limited to how it is used by other Jakarta specifications that I work on. |
|
Certainly that's possible, but I will ask on jta-dev if we have any volunteers first. Thank you for the contribution! |
|
FYI I have requested for volunteers over at https://www.eclipse.org/lists/jta-dev/msg00378.html |
While continuing to review the Transactions read-only feature for integration with the Jakarta Connector spec, I noticed a problem for XAResource/ExtendedXAResource implementations, which need more information about when they will need to handle
setReadOnly(xid)being invoked. This matters to the XAResource because some implementations will not be capable of changing the read-only behavior after the transaction has started. See the Connection.setReadOnly method of JDBC, which explicitly forbids changing read-only after a transaction has started. ExtendedXAResource.setReadOnly should provide guarantees that it can only be validly invoked prior to XAResource.start so that the XAResource can know before starting the transaction what the read-only will be and will never need to handle it changing during the transaction. I proposed a few sentences in the Javadoc to cover this.