Hi all,

I got a below error,

Caused by: <openjpa-2.2.1-r422266:1396819 nonfatal user error> 
org.apache.openjpa.persistence.InvalidStateException: Encountered unmanaged 
object "org.apache.openjpa.enhance.MEmployee$pcsubclass-670" in life cycle 
state  unmanaged while cascading persistence via field "MEmployee" during 
flush.  However, this field does not allow cascade persist. You cannot flush 
unmanaged objects or graphs that have persistent associations to unmanaged 
objects.
 Suggested actions:
 a) Set the cascade attribute for this field to CascadeType.PERSIST or 
CascadeType.ALL (JPA annotations) or "persist" or "all" (JPA orm.xml), 
 b) enable cascade-persist globally, 
 c) manually persist the related field value prior to flushing. 
 d) if the reference belongs to another context, allow reference to it by 
setting StoreContext.setAllowReferenceToSiblingContext().

About option D, would someone advise me how to get reference of StoreContext or 
it's implementation?

Thanks in advance.



Alex

Reply via email to