openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joel Halbert <>
Subject Unmanaged object in persistent fie - exception
Date Sun, 30 Jan 2011 17:23:16 GMT
Hi Folks,

I'm getting this exception, sporadically, non-reproducable.

Unmanaged object in persistent field ""
during flush.  However, this field does not allow cascade persist. Set the cascade attribute
for this field to CascadeType.PERSIST or CascadeType.ALL (JPA annotations) or "persist" or
"all" (JPA orm.xml), or enable cascade-persist globally, or manually persist the related field
value prior to flushing. You cannot flush unmanaged objects or graphs that have persistent
associations to unmanaged objects.
FailedObject: com.su3analytics.crawler.model.Host-1
	at org.apache.openjpa.kernel.SingleFieldManager.preFlushPC(
	at org.apache.openjpa.kernel.SingleFieldManager.preFlush(
	at org.apache.openjpa.kernel.SingleFieldManager.preFlush(
	at org.apache.openjpa.kernel.SingleFieldManager.preFlush(

I've tried alternating between  runtime (agent) and compile time
enhancement, and I get the error in both instances.

I am not setting the property: openjpa.RuntimeUnenhancedClasses

My code is loading an  existing persisted object, and creating a new
object with the existing object as a field. Effectively:

		ClientSeed cs = null;
			EntityManager em  = JPA.getEntityManagerFactory().createEntityManager();
			cs = em.find(ClientSeed.class, 1);

		// then later, on another thread

			EntityManager em = JPA.getEntityManagerFactory().createEntityManager();
			GlobalFrontier frontier = new GlobalFrontier();
			new GlobalFrontierDao(em).add(frontier);

The exception is only sporadic though.


View raw message