Regarding the earlier comment:
In this particular case, the issue in SynchronizationCallbackCoordinatorImpl.beforeCompletion was not due to a direct call to EntityManager interface. It was due to the transaction commit processing.
In the exception call stack, you can see that the persistence provider method org.hibernate.transaction.synchronization.HibernateSynchronizationImpl.beforeCompletion has been called and is involved. There is no distinction on what called the provider, the requirement is still the same whether the application called em.flush or is trying to commit the transaction.
|