No it doesn't.Quote:
Does the above quote does not apply to getSession of HibernateDaoSupport?
The ISOVI doesn't know about the session opened with getSession so that remains open, when a request comes in it opens a session, and closes it when the request has finished. However the getSession opens a new one.Quote:
If we were to do "releaseSession" specifically then what does the OSIVI do.
I happened to take the detailed logger of OSIVI and it appears that it (the OSIVI) indeed closes the session, below is an excerpt of the logs:
I suspect it is a co-incidence due to the getSession.Quote:
Can you also throw some light why the connection leak should happen on lazy load? Do you think its a mere co-incidence that its happening on lazy loads? I never saw connection leak when the data is accessed non-lazy way.
The rule of thumb if you use getSession manage/release the session yourself.
Because that will return the single session opened by the OSIVI.Quote:
Are there any specific reasons you want to suggest getCurrentSession() of sessionFactory?
If you want a stable application that should/is the way to go. You can leave the getSession() in place simply replace the extension of HibernateDaoSupport by your own class which also has a getSession().Quote:
BTW The application is already running in production and changing all getSession() to something else is a tedious task both from development and testing point of views.
Then you could quite easily do a search and replace...Code:public abstract class AbstractHibernateDao {
protected SessionFactory sessionFactory;
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory=sessionFactory;
}
protected final Session getSession() {
return sessionFactory.getCurrentSession();
}
..Other shared methods.
}
