protected static void openDBUnit() {

    try {
      connection = new DatabaseConnection(((SessionImpl) getEm().getDelegate()).connection());
    } catch (HibernateException e) {
      e.printStackTrace();
    } catch (DatabaseUnitException e) {
      e.printStackTrace();
    }
  }
 protected final void checkTables(String testName, String... tables) {
   getSession().commit();
   try {
     IDataSet dataSet = getCurrentDataSet();
     IDataSet expectedDataSet = getExpectedData(testName);
     for (String table : tables) {
       Assertion.assertEquals(expectedDataSet.getTable(table), dataSet.getTable(table));
     }
   } catch (DataSetException e) {
     throw translateException("Error while checking results", e);
   } catch (DatabaseUnitException e) {
     fail(e.getMessage());
   }
 }