OpenJPAEntityManager pm =
(OpenJPAEntityManager) currentEntityManager();
startTx(pm);
deleteAll(Entity1.class);
endTx(pm);
Entity1 o = new Entity1(8, "pk 8", 4);
startTx(pm);
pm.persist(o);
endTx(pm);
Object oid = pm.getObjectId(o);
endEm(pm);
pm = (OpenJPAEntityManager) currentEntityManager();
o = (Entity1) pm.find(Entity1.class, oid);
try {
o.setStringField("hello");
fail("non-transactional write should not be allowed");
} catch (Exception e) {
// expected
} finally {
endEm(pm);