jaybird
jaybird copied to clipboard
Possible XA bug: local transaction should be suspended when starting XA transaction [JDBC189]
Submitted by: @mrotteveel
Assigned to: Roman Rokytskyy (rrokytskyy)
Potential bug (needs more investigation): When XA start() is called on the XAResource an exception is thrown if the connection is currently involved in a local transaction. If I am reading the XA and JTA specs correctly this local transaction should be suspended when start() is called and resumed again on end().
Investigation required: re-read specs to see if above intepretation is correct.
Modified by: @mrotteveel
description: Potential bug (needs more investigation): When XA start() is called on the XAResource an exception is thrown if the connection is currently involved in a transaction. If I am reading the XA and JTA specs correctly this local transaction should be suspended when start() is called and resumed again on end().
Investigation required: re-read specs to see if above intepretation is correct.
=>
Potential bug (needs more investigation): When XA start() is called on the XAResource an exception is thrown if the connection is currently involved in a local transaction. If I am reading the XA and JTA specs correctly this local transaction should be suspended when start() is called and resumed again on end().
Investigation required: re-read specs to see if above intepretation is correct.
From JTA 1.3, section 3.4.7 Local and Global Transactions:
When using the same connection to perform both local and global transactions, the following rules apply:
- The local transaction must be committed (or rolled back) before starting a global transaction in the connection.
- The global transaction must be disassociated from the connection before any local transaction is started.
In other words, a local transaction should not be suspended, and throwing an exception is the correct behaviour
I'll take this ticket as an opportunity to review the current XA code. It seems on occasion it returns wrong (or less specific) error codes.