Fixes are available
8.5.0.2: WebSphere Application Server V8.5 Fix Pack 2
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
When the SQL for a named query is generated, the "name" attribute of a @JoinColumn is ignored when the "table" attribute is also specified. This is issue is specific to JPA 2.x only. Following error may be noted ERROR: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=T1.OWNER_EMPNO, DRIVER=3.57.82 {prepstmnt 65007978 SELECT t0.hwserial, t0.hwtype, t1.empno, t0.hwname, t2.empno, t2.empname FROM HWASSETS t0 INNER JOIN HWASSETSOWNERSHIP t1 ON t0.hwtype = t1.HWTYPE AND t0.hwserial = t1.HWSERIAL LEFT OUTER JOIN PEOPLE t2 ON t1.OWNER_EMPNO = t2.empno WHERE (t1.empno = ?) [params=?]} [code=-206, state=42703]SQLCA OUTPUT[Errp=SQLNQ075, Errd=-2145779603, 0, 0, 0, -10, 0] DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=T1.OWNER_EMPNO, DRIVER=3.57.82 DB2 SQL Error: SQLCODE=-727, SQLSTATE=56098, SQLERRMC=2;-206;42703;T1.OWNER_EMPNO, DRIVER=3.57.82 DB2 SQL Error: SQLCODE=-727, SQLSTATE=56098, SQLERRMC=2;-206;42703;T1.OWNER_EMPNO, DRIVER=3.57.82
Local fix
try adding the following line to the preperties section of the persistence.xml file <property name="openjpa.Compatibility" value="NonDefaultMappingAllowed=false"/>
Problem summary
**************************************************************** * USERS AFFECTED: All users of IBM WebSphere Application * * Server V8.0 and V8.5 who make use of * * @JoinColumn name when mapping a * * unidirectional owned OneToOne that is in a * * SecondaryTable. * **************************************************************** * PROBLEM DESCRIPTION: JoinColumn annotation is ignored when * * mapping a unidirectional owned * * OneToOne that is in a SecondaryTable . * **************************************************************** * RECOMMENDATION: * **************************************************************** The OpenJPA runtime incorrectly ignores @JoinColumn name when mapping a unidirectional owned OneToOne that is in a SecondaryTable. This problem only exists when running with a persistence.xml that is set to 2.0 (version="2.0">). For example: @Entity @SecondaryTable(name = "ParentSecondaryTable", pkJoinColumns = { @PrimaryKeyJoinColumn(name = "idParent", referencedColumnName = "idParent") }) public class Parent { @Id @GeneratedValue int idParent; String child_ref; @OneToOne @JoinColumn(name = "CHILD_REF", table = "ParentSecondaryTable", referencedColumnName = "idChild") PChild child; } The column "CHILD_REF" will be ignored and the runtime will look for the Foreign Key in non-existent column ParentSecondaryTable.CHILD_IDCHILD.
Problem conclusion
With this fix, code has been added to OpenJPA to ensure the JoinColumn annotation's name field is not ignored in a unidirectional OneToOne mapping that is in a SecondaryTable The fix for this APAR is currently targeted for inclusion in Service Levels (Fix Packs) 8.0.0.6 and 8.5.0.2 of WebSphere Application Server versions 8.0.0 and 8.5.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
PM70566
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-08-08
Closed date
2013-01-02
Last modified date
2013-01-02
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
PM78151 PM80441
Fix information
Fixed component name
WEBSPHERE APP S
Fixed component ID
5724J0800
Applicable component levels
R800 PSY
UP
R850 PSY
UP
Document Information
Modified date:
29 October 2021