Fixes are available
8.5.5.6: WebSphere Application Server V8.5.5 Fix Pack 6
8.5.5.7: WebSphere Application Server V8.5.5 Fix Pack 7
8.5.5.8: WebSphere Application Server V8.5.5 Fix Pack 8
8.5.5.9: WebSphere Application Server V8.5.5 Fix Pack 9
8.5.5.10: WebSphere Application Server V8.5.5 Fix Pack 10
8.5.5.11: WebSphere Application Server V8.5.5 Fix Pack 11
8.5.5.12: WebSphere Application Server V8.5.5 Fix Pack 12
8.5.5.13: WebSphere Application Server V8.5.5 Fix Pack 13
8.5.5.14: WebSphere Application Server V8.5.5 Fix Pack 14
8.5.5.15: WebSphere Application Server V8.5.5 Fix Pack 15
8.5.5.17: WebSphere Application Server V8.5.5 Fix Pack 17
8.5.5.20: WebSphere Application Server V8.5.5.20
8.5.5.18: WebSphere Application Server V8.5.5 Fix Pack 18
8.5.5.19: WebSphere Application Server V8.5.5 Fix Pack 19
8.5.5.16: WebSphere Application Server V8.5.5 Fix Pack 16
8.5.5.21: WebSphere Application Server V8.5.5.21
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
Document Information
Modified date:
28 April 2022