Hello, i have problem with exception as below.This is throwing when i try merge object between beginTransaction() ..merge.. commit(); block.
Of course i getting from database the same object outside this block, so i need to use merge, which not work.
This exception is throwing, when object is no in session, but i'am sure that, he is in session because when i call update, then i got error :
two object with the same identifier are associated with session, Why currentSession().contains doesn't work ?
Quote:
if(currentSession().contains(entityInstance))
currentSession().merge(entityInstance);
else
throw new HibernateException("Cannot merge.");
Please for any suggestions, or another way to resolve my problem.
Regards