em.close();
}
public void testPNonTransToPDirty() {
em.setOptimistic(false);
UnenhancedPropertyAccess o = (UnenhancedPropertyAccess)
em.createQuery("select o from UnenhancedPropertyAccess o")
.getSingleResult();
em.getTransaction().begin();
try {
Broker b = JPAFacadeHelper.toBroker(em);
OpenJPAStateManager sm = b.getStateManager(o);
assertEquals(PCState.PNONTRANS, sm.getPCState());
o.setLazyField("foo");
assertEquals(PCState.PDIRTY, sm.getPCState());
} finally {
em.getTransaction().rollback();
}
}