Fixes are available
PM29091; 7.0.0.13: jpa/openjpa throws an unexpected invalidstateexception during
7.0.0.17: Java SDK 1.6 SR9 FP1 Cumulative Fix for WebSphere Application Server
7.0.0.27: Java SDK 1.6 SR13 FP2 Cumulative Fix for WebSphere Application Server
7.0.0.19: Java SDK 1.6 SR9 FP2 Cumulative Fix for WebSphere Application Server
7.0.0.21: Java SDK 1.6 SR9 FP2 Cumulative Fix for WebSphere
7.0.0.23: Java SDK 1.6 SR10 FP1 Cumulative Fix for WebSphere
7.0.0.25: Java SDK 1.6 SR11 Cumulative Fix for WebSphere Application Server
7.0.0.27: Java SDK 1.6 SR12 Cumulative Fix for WebSphere Application Server
7.0.0.29: Java SDK 1.6 SR13 FP2 Cumulative Fix for WebSphere Application Server
7.0.0.45: Java SDK 1.6 SR16 FP60 Cumulative Fix for WebSphere Application Server
7.0.0.31: Java SDK 1.6 SR15 Cumulative Fix for WebSphere Application Server
7.0.0.35: Java SDK 1.6 SR16 FP1 Cumulative Fix for WebSphere Application Server
7.0.0.37: Java SDK 1.6 SR16 FP3 Cumulative Fix for WebSphere Application Server
7.0.0.39: Java SDK 1.6 SR16 FP7 Cumulative Fix for WebSphere Application Server
7.0.0.41: Java SDK 1.6 SR16 FP20 Cumulative Fix for WebSphere Application Server
7.0.0.43: Java SDK 1.6 SR16 FP41 Cumulative Fix for WebSphere Application Server
APAR status
Closed as program error.
Error description
An InvalidStateException is being thrown to the SystemOut.log when attempting to persist an entity which contains an interface as a persistable field. Here is the complete stack. Exception data: <openjpa-1.2.3-SNAPSHOT-r422266:965640 fatal user error> org.apache.openjpa.persistence.InvalidStateException: Encountered unmanaged object in persistent field "com.xx.xxx.res.subscription. Subscription._subscriberLocator" 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.xxx.xxxr.xx.ejb.EJBLocator@55ed55ed at org.apache.openjpa.kernel.SingleFieldManager.preFlushPC(SingleFi eldManager.java:754) at org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFiel dManager.java:601) at org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFiel dManager.java:562) at org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFiel dManager.java:478) at org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManager Impl.java:2829) at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:3 9) at org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateMana gerImpl.java:960) at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1967) at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1 927) at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1698) at org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroke r.java:989) at org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityMan agerImpl.java:598) at com.ibm.ws.jpa.management.JPATxEmInvocation.flush(JPATxEmInvocat ion.java:243) at com.ibm.ws.jpa.management.JPAEntityManager.flush(JPAEntityManage r.java:211) <Removed customer specific code here>
Local fix
Problem summary
**************************************************************** * USERS AFFECTED: All users of IBM ‚ ® WebSphere ‚ ® Applicatio * Server V7.0.0 whose entity contains a * * serializable object which in turn * * implements an interface. * **************************************************************** * PROBLEM DESCRIPTION: InvalidStateException is thrown when * * persisting a serializable which * * implements an interface. * **************************************************************** * RECOMMENDATION: * **************************************************************** Take the following pseudo code: public interface ICar extends Serializable {...} public class CarImpl implements ICar {...} @Entity public class MyEntity implements Serializable { protected ICar _car; ... } If a user has code similar to the above, when persisting a 'MyEntity', an InvalidStateException will be thrown given the class/interface hierarchy. OpenJPA doesn't recognize the type of the ICar persistable field as being an interface.
Problem conclusion
With this fix, code has been added to ensure that a persistable field which is an interface is properly recognized and persisted. The fix for this APAR is currently targeted for inclusion in Service Level (Fix Pack) 7.0.0.17 of WebSphere Application Server version 7.0.0. Please refer to the recommended updates page for delivery information: http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
Temporary fix
Comments
APAR Information
APAR number
PM29091
Reported component name
WEBSPHERE APP S
Reported component ID
5724J0800
Reported release
700
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2010-12-16
Closed date
2010-12-30
Last modified date
2010-12-30
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
WEBSPHERE APP S
Fixed component ID
5724J0800
Applicable component levels
R700 PSY
UP
Document Information
Modified date:
27 October 2021