Hello fellow Hibernate Users!
Im currently in the process of rewriting an application using Spring(2.x) and Hibernate(3.x). as it is now i have a lot of DAO classes and some Service classes using the DAO's.
All DAO classes are using the HibernateDAOSuport class.
In this application performance is a great issue, and it is simply not possible to open a new session eveytime a DAO method is invoked.
At the same time there are currently no transaction management as well, as we fear this might criple our performance further.
My Question is this:
When, and how do i manage the opening and closing of Sessions in order to open as few as possible?
I have considered allowing a lot of the find queries to use the same session, but im unsure as how this would be implemented, and if this is a good way to do things.
i have also considered lettign the Service classes open the sessiones and pass them on to the DAO classes whenever such is used.
Hope someone can help me out.
Best regards.
MadsJac
|