If using a connection with no timeout starts an XA transaction with
and some work is done but the application fails without calling
then another application cannot join that transaction using
and then commit or rollback the transaction. Basically the transaction is ACTIVE but cannot be rolled back or committed and will exist until the database server is restarted.
This is similar to
DERBY-2220. With DERBY-2220, it too will not work if the XAResource does not have a timeout specified either. This is simple to test by using the test code attached to DERBY-2220 and comment out the setting of the timeout. Once doing so, the transaction will be maintained and the locks will not be released.
This might be a deviation from the XA standard but I cannot tell. It seems as if a XA connection does not have a timeout set is active (that is XAResource.start has been called but XAResource.end has not) and the connection gets closed, the XA transaction should be rolled back implicitly. This is being done if the XAResource has a timeout set so it seems that it would not be too hard to do in this case either.