assertEquals(3, hv.getVersion().longValue());
}
public void testVersionIncrement_NoTxn() {
switchDatasource(EntityManagerFactoryName.nontransactional_ds_non_transactional_ops_allowed);
HasIntegerVersionJPA hv = new HasIntegerVersionJPA();
hv.setValue("value");
em.persist(hv);
em.close();
assertEquals(1L, hv.getVersion().longValue());
em = emf.createEntityManager();
hv = em.find(hv.getClass(), hv.getId());
hv.setValue("another value");
em.close();
assertEquals(2, hv.getVersion().longValue());
em = emf.createEntityManager();
hv.setValue("yet another value");
hv = em.merge(hv);
em.close();
assertEquals(3, hv.getVersion().longValue());
}