IBM Support

PM29091: JPA/OPENJPA THROWS AN UNEXPECTED INVALIDSTATEEXCEPTION DURING PERSISTENCE OF AN ENTITY WITH LOB COLUMN

Subscribe

You can track all active APARs for this component.

 

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 &#130; &#174; WebSphere &#130; &#174; 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

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.0","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
27 October 2021