I have a complex workflow business call to refactor: this workflow retrieves, updates and delete some entities on the DB. In the end I try to delete an entity, and once I commit the transaction I get:
javax.persistence.EntityNotFoundException: deleted entity passed to persist:[com.my.Entity#<null>]
I think there's another operation conflicting with this delete, but I cannot figure out which.
It there a way (logging some debug information in Hibernate), on the commit phase, to see the operations associated to each entity?
Is there a way to dump the inner state of the entity manager?
As this operation occurs only once the commit() is fired I cannot sort out where the conflict occurs.