The returned object reflects the changes, and it is attached to hibernate session.
Hibernate Template also takes care of obtaining or releasing sessions and hence the callback function or invoking function does not have to manage sessions.
This can be very tedious issue, since that means if you need to save an object that is not attached to a session, you need to do these.
object must be attached to a hibernate session (including all sub objects within the object), and once save/update is done, the object reflects the updated changes (e.g.
“, and going towards more powerful default optimization.
In fact, Rod Johnson (leader of Spring Framework’s parenthood gang :)), and other Spring Source consultants, constantly mention that most of their time, on projects that use Hibernate, is spent fixing Hibernate optimization bugs.