Hibernate version:
* Hibernate Core 3.2.0.CR2
* Hibernate Annotation 3.2.0.CR1
* Hibernate Entity Manager 3.2.0.CR1
Environment
A Java SE extended persistence context.
Code between emf.createEntityManager() and em.close():
Code:
em.getTransaction().begin();
Initiative i = new Initiative("initiative1");
em.persist(i);
em.getTransaction().commit();
em.clear();
em.getTransaction().begin();
em.refresh(i);
em.getTransaction().commit();
Description of Problem
The spec says calling em.clear() causes all managed entities to be detached. It also says calling em.refresh() on an entity that is not managed should throw an exception. Thus, the above test should result in an exception, but it does not. (Nor does it seem to refresh the entity.)
Should I file a JIRA report?
I posted another problem with Java SE extended persistence contexts,
http://forum.hibernate.org/viewtopic.php?t=960885, are they as well supported as the more common transaction scoped contexts?