PK77658: JPA ISSUES WITH NAMED QUERY ( @NAMEDQUERY ) AFTER PK69000

Fixes are available

7.0.0.3: WebSphere Application Server V7.0 Fix Pack 3 for IBM i
7.0.0.3: WebSphere Application Server V7.0 Fix Pack 3 for AIX
7.0.0.3: WebSphere Application Server V7.0 Fix Pack 3 for HP-UX
PK77658; 6.1.0.21: jpa issues with named query (@namedquery)
7.0.0.3: Java SDK 1.6 SR4 Cumulative Fix for WebSphere Application Server
7.0.0.3: WebSphere Application Server V7.0 Fix Pack 3 for Solaris
7.0.0.3: WebSphere Application Server V7.0 Fix Pack 3 for Linux
7.0.0.5: WebSphere Application Server V7.0 Fix Pack 5 for AIX
7.0.0.3: WebSphere Application Server V7.0 Fix Pack 3 for Windows
7.0.0.5: WebSphere Application Server V7.0 Fix Pack 5 for IBM i
7.0.0.5: WebSphere Application Server V7.0 Fix Pack 5 for Windows
7.0.0.5: WebSphere Application Server V7.0 Fix Pack 5 for HP-UX
7.0.0.5: Java SDK 1.6 SR5 Cumulative Fix for WebSphere Application Server
7.0.0.5: WebSphere Application Server V7.0 Fix Pack 5 for Solaris
7.0.0.5: WebSphere Application Server V7.0 Fix Pack 5 for Linux
7.0.0.7: WebSphere Application Server V7.0 Fix Pack 7 for IBM i
7.0.0.7: WebSphere Application Server V7.0 Fix Pack 7 for AIX
7.0.0.7: WebSphere Application Server V7.0 Fix Pack 7 for Windows
7.0.0.7: WebSphere Application Server V7.0 Fix Pack 7 for HP-UX
7.0.0.7: Java SDK 1.6 SR6 Cumulative Fix for WebSphere Application Server
7.0.0.7: WebSphere Application Server V7.0 Fix Pack 7 for Solaris
7.0.0.7: WebSphere Application Server V7.0 Fix Pack 7 for Linux
7.0.0.9: WebSphere Application Server V7.0 Fix Pack 9 for IBM i
7.0.0.9: WebSphere Application Server V7.0 Fix Pack 9 for Windows
7.0.0.9: WebSphere Application Server V7.0 Fix Pack 9 for AIX
7.0.0.9: WebSphere Application Server V7.0 Fix Pack 9 for HP-UX
7.0.0.9: Java SDK 1.6 SR7 Cumulative Fix for WebSphere Application Server
7.0.0.9: WebSphere Application Server V7.0 Fix Pack 9 for Solaris
7.0.0.9: WebSphere Application Server V7.0 Fix Pack 9 for Linux
7.0.0.11: WebSphere Application Server V7.0 Fix Pack 11 for IBM i
7.0.0.11: WebSphere Application Server V7.0 Fix Pack 11 for Windows
7.0.0.11: WebSphere Application Server V7.0 Fix Pack 11 for HP-UX
7.0.0.11: WebSphere Application Server V7.0 Fix Pack 11 for AIX
7.0.0.11: Java SDK 1.6 SR7 Cumulative Fix for WebSphere Application Server
7.0.0.11: WebSphere Application Server V7.0 Fix Pack 11 for Solaris
7.0.0.11: WebSphere Application Server V7.0 Fix Pack 11 for Linux
7.0.0.13: WebSphere Application Server V7.0 Fix Pack 13 for AIX
7.0.0.13: WebSphere Application Server V7.0 Fix Pack 13 for HP-UX
7.0.0.13: WebSphere Application Server V7.0 Fix Pack 13 for IBM i
7.0.0.13: WebSphere Application Server V7.0 Fix Pack 13 for Linux
7.0.0.13: WebSphere Application Server V7.0 Fix Pack 13 for Solaris
7.0.0.13: WebSphere Application Server V7.0 Fix Pack 13 for Windows
7.0.0.13: Java SDK 1.6 SR8FP1 Cumulative Fix for WebSphere Application Server
7.0.0.15: WebSphere Application Server V7.0 Fix Pack 15 for AIX
7.0.0.15: Java SDK 1.6 SR9 Cumulative Fix for WebSphere Application Server
7.0.0.15: WebSphere Application Server V7.0 Fix Pack 15 for HP-UX
7.0.0.15: WebSphere Application Server V7.0 Fix Pack 15 for IBM i
7.0.0.15: WebSphere Application Server V7.0 Fix Pack 15 for Linux
7.0.0.15: WebSphere Application Server V7.0 Fix Pack 15 for Solaris
7.0.0.15: WebSphere Application Server V7.0 Fix Pack 15 for Windows
7.0.0.17: WebSphere Application Server V7.0 Fix Pack 17
7.0.0.17: Java SDK 1.6 SR9 FP1 Cumulative Fix for WebSphere Application Server
7.0.0.19: WebSphere Application Server V7.0 Fix Pack 19
7.0.0.21: WebSphere Application Server V7.0 Fix Pack 21
7.0.0.23: WebSphere Application Server V7.0 Fix Pack 23
7.0.0.25: WebSphere Application Server V7.0 Fix Pack 25
7.0.0.27: WebSphere Application Server V7.0 Fix Pack 27
7.0.0.29: WebSphere Application Server V7.0 Fix Pack 29
7.0.0.31: WebSphere Application Server V7.0 Fix Pack 31
7.0.0.27: Java SDK 1.6 SR13 FP2 Cumulative Fix for WebSphere Application Server

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • JPA issues with named query ( @NamedQuery )
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of the Java Persistence API       *
    *                  (JPA) with Oracle databases on WebSphere    *
    *                  Application Server                          *
    ****************************************************************
    * PROBLEM DESCRIPTION: Incorrect SQL is generated for Java     *
    *                      Persistence Query Language              *
    *                      (JPQL) queries which contain a sub      *
    *                      query.                                  *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    When a JPQL query is executed on multiple entities and
    contains a sub query the generated SQL might not include the
    correct table aliases.
    
    For example consider this JPQL query :
    SELECT e,d from Employee e, Dependent d
         WHERE e.empId = :empid
         AND d.id.empid = (SELECT MAX (e2.empId) FROM Employee e2)
         AND d.id.effDate > :minDate
         AND d.id.effDate < :maxDate
    
    The generated SQL might look like this :
    ELECT t0.empId, t3.effDate, t3.empid, t3.name
        FROM SUBQ_EMPLOYEE t0, SUBQ_DEPENDENT t3
        WHERE (t0.empId = ?
        AND t1.empid = (SELECT MAX(t2.empId) FROM SUBQ_DEPENDENT
                t1, SUBQ_EMPLOYEE t2)
        AND t3.effDate > ?
        AND t3.effDate < ?
    
    The SQL is missing the definition for table alias t1 and t2.
    When this occurs a SQLException is thrown by the JDBC
    provider. For example :
    
    openjpa-1.0.4-SNAPSHOT-r420667:740105M nonfatal general error>
    org.apache.openjpa.persistence.PersistenceException:
    ORA-00904: "T1"."EMPID": invalid identifier
     {prepstmnt 23206283 SELECT t0.empId, t3.effDate, t3.empid,
    t3.name FROM SUBQ_EMPLOYEE t0, SUBQ_DEPENDENT t3 WHERE
    (t0.empId = ? AND t1.empid = (SELECT MAX(t2.empId) FROM
    SUBQ_DEPENDENT t1, SUBQ_EMPLOYEE t2) AND t3.effDate > ? AND
    t3.effDate < ?) [params=(long) 101, (Timestamp) 1969-12-31
    18:00:00.1, (Timestamp) 1969-12-31 18:01:40.0]} [code=904,
    state=42000]
     at
    org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDic
    tionary.java:3951)
     at
    org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions
    .java:97
    
    <snip>
    
    estedThrowables:
    java.sql.SQLException: ORA-00904: "T1"."EMPID": invalid
    identifier
     at
    oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError
    .java:112)
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PK77658

  • Reported component name

    WEBSPHERE APP S

  • Reported component ID

    5724J0800

  • Reported release

    61W

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2008-12-17

  • Closed date

    2009-02-11

  • Last modified date

    2009-02-24

  • 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

  • R61A PSY

       UP

  • R61H PSY

       UP

  • R61I PSY

       UP

  • R61P PSY

       UP

  • R61S PSY

       UP

  • R61W PSY

       UP

  • R61Z PSY

       UP



Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

WebSphere Application Server
General

Software version:

6.1

Reference #:

PK77658

Modified date:

2009-02-24

Translate my page

Machine Translation

Content navigation