So i have this entities:
And when I try to update TwitchChannel entity, using session.update(), nothing really happens. It doesn't throw an exception or log anything, code after update call doesn't get executed. I set hibernate's batch size to zero, so it shouldn't batch updates.
Update function in dao looks like this:
channelDao.update() simply calls session.update().
Thank to @Pijotrek, wrapping update call in try/catch block helped and hibernate actually threw:
Illegal attempt to associate a collection with two open sessions
Replacing session.update() with session.merge() solved the issue!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.