Hibernate version: 3.2.5
We've being using Hibernate for many years now and we love it. Recently, we found that the Hibernate Entity Manager - when asked to merge using a long transaction - will actually load the object again from the database (if its not available in the first or second level cache). Why does it do this? Why does it not simply use the detached object? Hibernate saveOrUpdate doesn't load the object, why does merge?
In addition to inefficiency, this causes problems when you load object using native queries. Hibernate will generate its own query during merge and this may clash with the mapping.
I miss the older, simpler Hibernate days...
|