openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jerry Carter <je...@jerrycarter.org>
Subject Refreshing detached entities
Date Thu, 11 Mar 2010 17:21:13 GMT

Possible gap in my understanding, but I would expect an exception in this case based on section
3.2.5 of the JPA 2.0 specification: "If [entity] X is new, detached, or removed entity, the
IllegalArgumentException is thrown".

try {
	TestEntity refreshDetached = new TestEntity("refresh detached");
	em.persist(refreshDetached);
	em.flush();
	em.detach(refreshDetached);
	em.refresh(refreshDetached);
	logger.error("ERROR: No exception from em.refresh(detached)");
} catch (IllegalArgumentException e) {
	logger.info("SUCCESS: Refresh detached");
} catch (Exception e) {
	logger.error("ERROR: Unexpected exception from em.refresh(detached): " + e.toString());
}

ERROR: No exception from em.refresh(detached)



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message