0

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.

JayZee
  • 851
  • 1
  • 10
  • 17

1 Answers1

1

Enable log and sql trace in your hibernate.cfg.xml

<property name="show_sql">true</property>
<property name="format_sql">true</property>

for a fast solution.
If not enought configure your logger like described here.
Look here for parameters value substitution.

Community
  • 1
  • 1
Luca Basso Ricci
  • 17,829
  • 2
  • 47
  • 69