Fixes are available
8.0.0.5: WebSphere Application Server V8.0 Fix Pack 5
8.0.0.6: WebSphere Application Server V8.0 Fix Pack 6
8.0.0.7: WebSphere Application Server V8.0 Fix Pack 7
8.0.0.8: WebSphere Application Server V8.0 Fix Pack 8
8.0.0.9: WebSphere Application Server V8.0 Fix Pack 9
8.0.0.10: WebSphere Application Server V8.0 Fix Pack 10
8.0.0.11: WebSphere Application Server V8.0 Fix Pack 11
8.0.0.12: WebSphere Application Server V8.0 Fix Pack 12
8.0.0.13: WebSphere Application Server V8.0 Fix Pack 13
8.0.0.14: WebSphere Application Server V8.0 Fix Pack 14
8.0.0.15: WebSphere Application Server V8.0 Fix Pack 15
APAR status
Closed as program error.
Error description
OpenJPA generate incorrect SQL. Bidirectional OneToMany relations returns an emplty list when traversing the OneToMany side of the relations. When traversing the ManyToOne side of the realtison, all works well. [1/25/12 11:12:37:871 EST] 000000cd jdbc_SQL 3 openjpa.jdbc.SQL: Trace: <t 64607553, conn 65859648> executing prepstmnt 65860094 SELECT t1.id, t0.id, t2.id, t3.id, t1.name FROM UML.UMLType t0 INNER JOIN UML.UMLNamed t1 ON t0.id = t1.id LEFT OUTER JOIN UML.UMLClass t2 ON t0.id = t2.id LEFT OUTER JOIN UML.UMLPrimitiveType t3 ON t0.id = t3.id WHERE t0.OWNERPACKAGE_ID = ?AND t2.id IS NULL AND t3.id IS NULL [params=?]
Local fix
N/A
Problem summary
**************************************************************** * USERS AFFECTED: All users of IBM WebSphere Application * * Server V8.0.0 who make use of * * bidirectional OneToMany relationships in * * their JPA Entities. * **************************************************************** * PROBLEM DESCRIPTION: Traversal of a OneToMany relationship * * returns an empty list when * * InheritanceType.JOINED or * * SINGLE_TABLE is used. * **************************************************************** * RECOMMENDATION: * **************************************************************** Their exsists the potential for SQL to be incorrectly generated when InheritanceType.JOINED or InheritanceType.SINGLE_TABLE is used. The issue occurs when a parent class defined with @Inheritance(strategy=InheritanceType.JOINED) and a subclasses in the hierarchy contains a (bidirectional) OneToMany relationship. When traversing the ManyToOne side of the relations, all works well. But when traversing the OneToMany side an empty list is returned. It was observed that OpenJPA generated incorrect SQL, as follows: SELECT t1.id, t0.id, t2.id, t3.id, t1.name FROM UMLType t0, UMLNamed t1, UMLClass t2, UMLPrimitiveType t3 WHERE t0.OWNERPACKAGE_ID = ? AND t2.id IS NULL AND t3.id IS NULL AND t0.id = t1.id AND t0.id = t2.id(+) AND t0.id = t3.id(+) Note that the 't2.id IS NULL AND t3.id IS NULL' is suspect.
Problem conclusion
With this fix code has been added to OpenJPA to ensure that proper SQL is generated when a parent entity uses InheritanceType.JOINED or InheritanceType.SINGLE_TABLE. The fix for this APAR is currently targeted for inclusion in Service Level (Fix Pack) 8.0.0.5 of WebSphere Application Server version 8.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
PM60051
Reported component name
WEBSPHERE APP S
Reported component ID
5724J0800
Reported release
800
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2012-03-08
Closed date
2012-05-25
Last modified date
2012-07-17
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
R800 PSY
UP
Document Information
Modified date:
28 October 2021