I am using JPA . I am getting the following error when running through multiple transactions.
For example add
-
Add Event 21
-
Add Event 22
-
Delete 22
-
Delete 21
Now when I go in to add a new event it indicates that a different object is already associated with this session.
org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.domain.Event#22]
I think I understand what is going on but am not sure how to solve this problem.
Thanks
Have you tried flushing the session before recreating the deleted entity?