-
Bug
-
Resolution: Done
-
Major
-
4.2.3.SP5, 4.2.3.CP01, 4.3.0.GA
-
None
There exists a race condition such that we may call start on an XAResource but never call end (or anything else) on it if the transaction times out whilst the resource enlistment is still in progress. This is a Bad Thing and may make resource managers unhappy.
To reproduce:
TransactionManager tm = new TransactionManagerImple();
tm.setTransactionTimeout(5);
tm.begin();
Transaction t = tm.getTransaction();
// XAResourceImpl has a start method with Thread.sleep longer than 5s
XAResource xaResource = new XAResourceImpl();
t.enlistResource(xaResource);
Thread.sleep(10);
// reaper times out the tx, resource manager for XAResource
// may have received start but never receives end.
Fix notes: TransactionImple.enlistResource needs to lock out the reaper thread. At first glance an alternative fix is to put the resource into the transaction's internal data structure before calling start on it, but that would allow an 'end, begin' sequence of calls to be seen by the resource manager.
caution: ref support case i-t #171373 there may exist additional race conditions in the app server JCA so this change alone won't necessarily fix the problem.
- is incorporated by
-
JBPAPP-771 race condition in XAResource start/end handling
- Resolved
- is related to
-
JBTM-362 add failure does not cause rollback/end
- Closed