atomikos/transactions-essentials

CheckedExportingTransactionManager is not thread-safe

martinaubele opened this issue · 0 comments

In a load test with many concurrent calls we got errors like:
"Pending outgoing remote request detected at transaction commit

  • forcing rollback since commit scope will not be as expected!"

We found out that CheckedExportingTransactionManager uses a HashMap in an unsafe way. We could fix the problem by changing the line

private static Map<String,PendingRequestSynchronisation> pendingRequestSynchronisation = new HashMap<String,PendingRequestSynchronisation>();

to

private static Map<String,PendingRequestSynchronisation> pendingRequestSynchronisation = new ConcurrentHashMap<String,PendingRequestSynchronisation>();

please see #221