Created attachment 947054 [details]
server.log with ConcurrentModificationException
This error is (probably) the same as it was reported here: https://bugzilla.redhat.com/show_bug.cgi?id=1010242
but for Sybase it seems to be reproducible quite consistently.
We run test where Byteman rule is added to stop XA transaction in prepare phase (BasicAction#prepare).
Then we call 3 ejbs which starts 3 transactions. Those are stuck at prepare.
When all three are prepared to proceed then we unblock the byteman rule and check the results.
In case of Sybase database it happens that during checking of state - before the byteman rule is unblock - the app server came with exception  and stays deadlocked.
I expect that this is hardly to obtain such state in standard usage but the code should be clean from ConcurrentModificationException.
ERROR [stderr] (Periodic Recovery) Exception in thread "Periodic Recovery" java.util.ConcurrentModificationException
ERROR [stderr] (Periodic Recovery) at java.util.HashMap$HashIterator.nextEntry(HashMap.java:922)
ERROR [stderr] (Periodic Recovery) at java.util.HashMap$KeyIterator.next(HashMap.java:956)
ERROR [stderr] (Periodic Recovery) at com.arjuna.ats.internal.jta.recovery.arjunacore.CommitMarkableResourceRecordRecoveryModule.periodicWorkFirstPass(CommitMarkableResourceRecordRecoveryModule.java:172)
ERROR [stderr] (Periodic Recovery) at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:747)
ERROR [stderr] (Periodic Recovery) at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:375)
I'm sorry incorrect link to 6.3.0 bugzilla. Correct is:
Just checked the code and it seems that the cause is at line:
Item from collection is removed but without iterator would know about it. It's needed to use iterator itself for removing the item.
Good spot. I will raise a JIRA and link it to this case.
Codebase changed, concurrent locking for Sybase seems to go away.
Verified for EAP 6.4.0.DR11
Tom Jenkinson <firstname.lastname@example.org> updated the status of jira JBTM-2271 to Closed