I am developing a Swing application, backed by Spring and Hibernate, and would like to have one session per application, in order to use lazy loading of associations. However, I noticed that SessionFactoryUtils (in behalf of HibernateTransactionManager) always closes the session at the end of a transaction. So, my first question is: is there any means to avoid this behavior?
That made me think about the lifecycles of sessions and transactions. Should not they be unrelated, unless I want they be? If so, the API should give me a way of configuring the desired lifecycle for sessions.
PS: Spring is great! Congratulations, people!


Reply With Quote