In Red Hat JBoss Data Grid, transactional caches are configured with optimistic locking by default. Concurrent <methodname>replace()</methodname> calls can return true under contention and transactions might unexpectedly commit.
Two concurrent commands, <command>replace(key, A, B)</command> and <command>replace(key, A, C)</command> may both overwrite the entry. The command which is finalized later wins, overwriting an unexpected value with new value.
This is a known issue in JBoss Data Grid 6.4. As a workaround, enable write skew check and the <parameter>REPEATABLE_READ</parameter> isolation level. This results in concurrent replace operations working as expected.