Affects Version/s: 1.3.2
Fix Version/s: 1.3.3
Number of attachments :
I tested the following failure scenario (Bitronix 1.3.2):
- Connect to two different instances of PostgreSQL (using driver 8.3-604) with XA connections
- Insert records into a table in each database
- Call commit on UserTransaction
- Break-point was set in BitronixTransaction.commit() approx line 180 - between prepare and commit
- While paused on break point (after prepare) I killed one of the databases
- Then I resumed execution
- The result was a HeuristicMixedException
- When I started the Postgresql instance back up, the commit recovered (as expected), and I ended up with the record in both databases - as should be, since prepare succeeded
But why did my application get a HeuristicMixedException ???
Per spec, this exception is defined as:
> thrown when a heuristic decision was made and some updates have been committed and others were rolled back
But no rollback occurred. Both resorces voted commit on prepare, only the second commit failed due to the resource being down. And in fact the commit happened when the resource was started back up.
BTM threw this to my application:
bitronix.tm.internal.BitronixHeuristicMixedException: transaction failed during commit of a Bitronix Transaction with GTRID [6D79544D546573740000011F4883413200000008], status=UNKNOWN, 2 resource(s) enlisted (started Thu Feb 05 15:16:15 MST 2009): resource(s) [datasource/ds2] improperly unilaterally rolled back (or hazard happened)
BTM logged this when the commit failed:
SEVERE: resource datasource/ds2 failed on a Bitronix XID [6D79544D546573740000011F4883413200000008 : 6D79544D546573740000011F488341350000000B]
bitronix.tm.internal.BitronixXAException: resource reported Unable to render embedded object: File (invalid error code (0)) not found. when asked to commit transaction branch
Caused by: javax.transaction.xa.XAException: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
... 8 more