When participant receives prepare from coordinator, it calls prepare on jta transaction. SubordinateAtomicAction.doPrepare then calls beforeCompletion() method. Hibernate registers Synchronization object which is called in beforeCompletion() method. In that synchronization object, when hibernate cannot find transaction on current thread, it flushes all entites into database, which is bad.
When Hibernate cannot find transaction on thread, it logs WARN [AbstractEntityManagerImpl] Transaction not available on beforeCompletionPhase: assuming valid
Fix is easy, BridgeParticipantAT should associate current thread with the corresponding JTA transaction. And finally it should suspend that JTA transaction.