HibernateDBConnection implements DBConnection<Session> { @Override public void rollback() throws SQLException { if (isTransActionAlive()) { getTransaction().rollback(); } }  @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);  }
@Test public void testRollback() throws SQLException { connection.getSession(); assertTrue("Transaction should be active", connection.getTransaction().isActive()); connection.rollback(); assertFalse("Rollback should close transaction", connection.getTransaction().isActive()); connection.rollback(); }