For efficiency reasons, Atomikos transaction manager commits transactions in a separate thread to the thread making the cache operations and until 4.2.1.CR1, Infinispan had problems with this type of scenarios and resulted on distributed caches not sending data to other nodes (see ISPN-927 for more details). Please note that replicaticated, invalidated or local caches would work fine. It's only distributed caches that would suffer this problem.
There're two ways to get around this issue, either:
- Upgrade to Infinispan 4.2.1.CR2 or higher where the issue has been fixed.
- If using Infinispan 4.2.1.CR1 or earlier, configure Atomikos so that com.atomikos.icatch.threaded_2pc is set to false. This results in commits happening in the same thread that made the cache operations.