Spring + Hibernate session management
Posted
by
toc777
on Stack Overflow
See other posts from Stack Overflow
or by toc777
Published on 2011-06-21T14:11:51Z
Indexed on
2011/06/21
16:22 UTC
Read the original article
Hit count: 214
I have been reading about using Spring with Hibernate and I am really confused about session management. Hopefully someone can clear a few things up for me,
First of all I have no idea how sessions are managed when using HibernateTemplate. Is a session opened and closed when you call a method Eg Save() on the template? When you use the find() method, are detached objects returned?
I have read the Spring section on transactions but it mostly talks about handling exceptions. I was hoping to find some way of binding a hibernate session to a Spring transaction so that I can commit changes to hibernate objects when the transaction finishes. Is there a way to achieve this?
© Stack Overflow or respective owner