@Override protected void assertCommitState(boolean insertRow, boolean isCommited) { if (insertRow) { EntityManager em = EntityManagerFactoryUtils.getTransactionalEntityManager(entityManagerFactory); em.persist(new TestBean(rowCount++, "Keith Donald")); } if (!isCommited) { assertEquals("Nothing should be committed yet", 1, getCount()); } else { assertEquals("All rows should be committed", rowCount, getCount()); } }