IBM Support

PM29091; 7.0.0.13: jpa/openjpa throws an unexpected invalidstateexception during

Download


Abstract

InvalidStateException is thrown when persisting a serializable which implements an interface.

Download Description

PM29091 resolves the following problem:

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)


LOCAL FIX:
None

PROBLEM SUMMARY:

* USERS AFFECTED: All users of IBM WebSphere Application 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:
None

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?uid=swg27004980

Prerequisites

Please download the UpdateInstaller below to install this fix.

[{"PRLabel":"UpdateInstaller","PRLang":"US English","PRSize":"7250000","PRPlat":{"label":"AIX","code":"PF002"},"PRURL":"http://www.ibm.com/support/docview.wss?uid=swg21205991"}]

Installation Instructions

Please review the readme.txt for detailed installation instructions.

[{"INLabel":"Readme","INLang":"US English","INSize":"10905","INURL":"ftp://public.dhe.ibm.com/software/websphere/appserv/support/fixes/PM29091/readme.txt"}]
On
[{"DNLabel":"7.0.0.13-WS-WAS-IFPM29091","DNDate":"1/11/2011","DNLang":"US English","DNSize":"4881185","DNPlat":{"label":"AIX","code":"PF002"},"DNURL":"http://www.ibm.com/support/fixcentral/quickorder?fixids=7.0.0.13-WS-WAS-IFPM29091&product=ibm%2FWebSphere%2FWebSphere+Application+Server&source=dbluesearch","DNURL_FTP":"ftp://public.dhe.ibm.com/software/websphere/appserv/support/fixes/PM29091/7.0.0.13-WS-WAS-IFPM29091.pak","DDURL":"http://public.dhe.ibm.com:7618;sw_websphere;appserv/support/fixes/PM29091/7.0.0.13-WS-WAS-IFPM29091.pak"}]

Technical Support

Contact IBM Support using SR (http://www.ibm.com/software/support/probsub.html), visit the WebSphere Application Server support web site (http://www.ibm.com/software/webservers/appserv/was/support/), or contact 1-800-IBM-SERV (U.S. only).

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Java Persistence API (JPA)","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"7.0.0.13","Edition":"Base;Express;Network Deployment","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg24029193