LDEV-3293: Use the new Spring's support for Hibernate 4 instead of Hibernate 3. Switch from using HibernateDaoSupport.getSession() to its getSessionFactory().getSession(). The latter is sure to close the session automatically while a session returned by the first method should be closed manually. Theoritecally we do it in OpenSessionInViewFilter, but it may not be always the case, leading to open Hibernate session being left behind.