Code example for Session

Methods: getSessionFactory

0
@ContextConfiguration(locations={ "/org/granite/test/tide/hibernate/spring/test-context-jpa-hibernate.xml" }) 
public class TestHibernate3TideLazyLoadingJPA extends AbstractTestTideLazyLoadingJPA { 
	 
	protected void checkSessionsClosed() { 
		Session session = (Session)entityManager.getDelegate();
		Assert.assertEquals("Sessions closed", session.getSessionFactory().getStatistics().getSessionOpenCount(), 
				session.getSessionFactory().getStatistics().getSessionCloseCount());
	} 
}