@Test public void testIsSessionAlive() throws SQLException { assertNotNull("DB connection should not be null", connection); assertNotNull("Session should not be null", connection.getSession()); assertTrue("A Session should be alive by default", connection.isSessionAlive()); connection.getTransaction().rollback(); assertTrue("A Session should still be alive if transaction closes", connection.isSessionAlive()); }
@Override public boolean isSessionAlive() { return sessionFactory.getCurrentSession() != null && sessionFactory.getCurrentSession().isOpen(); }
HibernateDBConnection implements DBConnection<Session> { @Override public boolean isSessionAlive() { return sessionFactory.getCurrentSession() != null && sessionFactory.getCurrentSession().isOpen(); } }
HibernateDBConnection implements DBConnection<Session> { @Override public boolean isSessionAlive() { return sessionFactory.getCurrentSession() != null && sessionFactory.getCurrentSession().isOpen(); }  }
HibernateDBConnection implements DBConnection<Session> { @Override public boolean isSessionAlive() { return sessionFactory.getCurrentSession() != null && sessionFactory.getCurrentSession().isOpen(); }  @Override Session getSession(); @Override boolean isTransActionAlive(); @Override boolean isSessionAlive(); @Override void rollback(); @Override void closeDBConnection(); @Override void commit(); @Override synchronized void shutdown(); @Override String getType(); @Override DataSource getDataSource(); @Override DatabaseConfigVO getDatabaseConfig(); @Override long getCacheSize(); @Override @SuppressWarnings("unchecked") E reloadEntity(final E entity); @Override void setConnectionMode(final boolean batchOptimized, final boolean readOnlyOptimized); @Override boolean isOptimizedForBatchProcessing(); @Override void uncacheEntity(E entity); }
HibernateDBConnection implements DBConnection<Session> { @Override public boolean isSessionAlive() { return sessionFactory.getCurrentSession() != null && sessionFactory.getCurrentSession().isOpen(); }  @Override Session getSession(); @Override boolean isTransActionAlive(); @Override boolean isSessionAlive(); @Override void rollback(); @Override void closeDBConnection(); @Override void commit(); @Override synchronized void shutdown(); @Override String getType(); @Override DataSource getDataSource(); @Override DatabaseConfigVO getDatabaseConfig(); @Override long getCacheSize(); @Override @SuppressWarnings("unchecked") E reloadEntity(final E entity); @Override void setConnectionMode(final boolean batchOptimized, final boolean readOnlyOptimized); @Override boolean isOptimizedForBatchProcessing(); @Override void uncacheEntity(E entity);  }