em.getTransaction().commit();
}
public void updateEntities(boolean flushBetween) {
em.getTransaction().begin();
SimpleEntity se = null;
assertEquals(NUM_INSERTS, _ids.size());
try {
for (Integer id : _ids) {
se = em.find(getEntityType(), id);
assertNotNull(String.format("%s::%d should be found",
getEntityTypeName(), id), se);
se.setForename(se.getForename() + " UPDATED");
if (flushBetween) {
em.flush();
}
}
} finally {
em.getTransaction().commit();
}
em.getTransaction().begin();
try {
for (Integer id : _ids) {
se = em.find(getEntityType(), id);
assertNotNull(String.format("%s::%d should be found",
getEntityTypeName(), id), se);
se.setSurname(se.getSurname() + " UPDATED");
if (flushBetween) {
em.flush();
}
}
} finally {