Details
-
Bug
-
Resolution: Done
-
Major
-
JBossAS-5.0.0.GA
-
None
Description
The TestWork class in TestResourceAdapterTxInflow implements XAResource but has some methods stubbed out to throw exceptions, on the basis that they are never invoked. One such is prepare(), on the assumption that a transaction containing only a single resource will always use one phase commit, skipping the prepare call. This is not the case. Whilst 1PC is a useful performance optimisation, it's not required. Also, it's not possible in certain distributed transaction cases, depending on the use of interposition. In particular, the JBossTS JTS implementation won't always use 1PC, which can cause this test case to fail.
Fix: modify TestWork.prepare to return XAResource.XA_OK instead of throwing XAException