-
Bug
-
Resolution: Done
-
Minor
-
5.1.6.FINAL
-
None
Currently HEAD DummyTransaction.java has this code:
...
for (XAResource res : resources) {
try {
int prepareStatus = res.prepare(xid);
transaction.setPrepareStatus(prepareStatus);
...
This means that transaction gets prepare status of the last resource (cache in case of infinispan) enlisted.
Also it has next code:
...
if (transaction.getPrepareStatus() == XAResource.XA_RDONLY)
else {
... Do commit ...
...
This means that if last resource returned XA_RDONLY (e.g. when on last cache only get was performed) all other resources are not committed.
For me this results in locks held indefinitely and transaction leak.
Correct would be to remember prepare status per-resource and act accordinly.