IBM Support

PI29817: JPA PERSISTENCE NOT WORKING IN CASE OF SPECIFYING O/R MAPPING INFORMATION IN ORM.XML

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • JPA persistence not working in case of specifying O/R mapping
    information in orm.xml so that JPA failed when accessing to
    database.
    

Local fix

  • In case of specifying O/R mapping information in annotation,
    it works without failure.
    
    In case of specifying O/R mapping information in annotation,
    it does work properly properly
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server V8.5.5 who define a table name in a  *
    *                  Java Persistence API (JPA) mapping          *
    *                  (orm.xml) file.                             *
    ****************************************************************
    * PROBLEM DESCRIPTION: Table name defined in XML mapping       *
    *                      file is not used when running a         *
    *                      named query.                            *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    Take this simple entity:
    @Entity
    @javax.persistence.NamedQuery(name =
    "TableNameInXmlEntity.findAll", query = "SELECT t FROM
    TableNameInXmlEntity t")
    public class TableNameInXmlEntity implements Serializable {
    @Id
    private int myid;
    .......
    Take this simple XML mapping entry:
    <entity-mappings
    ..........
    <entity
    class="org.apache.openjpa.persistence.xml.TableNameInXmlEntity">
    <table name="TableNameInXml"/>
    </entity>
    </entity-mappings>
    With this code, take the following test to run the named
    query:
    Query q = em.createNamedQuery("TableNameInXmlEntity.findAll");
    q.getResultList();
    The following SQL will be generated:
    SELECT t0.myid FROM TableNameInXmlEntity t0
    Notice that 'TableNameInXmlEntity' is used, rather than
    'TableNameInXml' (that is, the name defined in the XML mapping
    file).
    Rather than running a named query, if we run a query like the
    following:
    Query q = em.createQuery("SELECT t FROM TableNameInXmlEntity
    t");
    q.getResultList();
    The following (correct) SQL will be run:
    SELECT t0.myid FROM TableNameInXml t0
    Finally, if we run the above query, and THEN run the named
    query, all will work as expected.
    

Problem conclusion

  • With this fix, code has been added to OpenJPA to ensure that a
    table name defined in a mapping file is used in a named query.
    
    The fix for this APAR is currently targeted for inclusion in
    Service Level (Fix Pack) 8.5.5.6 of WebSphere Application
    Server version 8.5.5.
    
    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

    PI29817

  • Reported component name

    WEBS APP SERV N

  • Reported component ID

    5724H8800

  • Reported release

    850

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2014-11-18

  • Closed date

    2015-03-10

  • Last modified date

    2015-03-10

  • 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

    WEBS APP SERV N

  • Fixed component ID

    5724H8800

Applicable component levels

  • R850 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":"8.5","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
28 April 2022