Fixes are available
8.5.5.6: WebSphere Application Server V8.5.5 Fix Pack 6
8.0.0.11: WebSphere Application Server V8.0 Fix Pack 11
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.0.0.12: WebSphere Application Server V8.0 Fix Pack 12
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.0.0.13: WebSphere Application Server V8.0 Fix Pack 13
8.5.5.12: WebSphere Application Server V8.5.5 Fix Pack 12
8.0.0.14: WebSphere Application Server V8.0 Fix Pack 14
8.5.5.13: WebSphere Application Server V8.5.5 Fix Pack 13
8.0.0.15: WebSphere Application Server V8.0 Fix Pack 15
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
In WebSphere Application Server v8.5.5 and v8.0 when using JPA 2.2 with criteria builder and sub query, the wrong query is generated.
Local fix
Problem summary
**************************************************************** * USERS AFFECTED: All users of IBM WebSphere Application * * Server V8.0.0, V8.5.0, and V8.5.5 who make * * use of a JPA CriteriaBuilder and sub * * selects. * **************************************************************** * PROBLEM DESCRIPTION: A column is aliased twice in a * * subquery when the query is generated * * with CriteriaBuilder. * **************************************************************** * RECOMMENDATION: * **************************************************************** There is a scenario where an extra alias is generated for a query created by CriteriaBuilder. For the given scenario, a CriteriaBuild is created such that the resultant JPQL string when printed is as follows: SELECT f.employeeCount FROM DimDay d, FactWorkAssignment f WHERE (f.orgOID = 'dummy1' AND d.roll13MonthInd = 1 AND f.personObjId IN (SELECT f.personObjId FROM FactWorkAssignment f WHERE (f.orgOID = 'dummy1' AND d.monthStrtDate = 20150201)). When the CriteriaBuilder is used to run this query string, this SQL is generated: SELECT t0.empl_cnt FROM T_FACT_WORK_ASGNMT t0, T_DIM_DAY t1, T_DIM_DAY t3 WHERE (t0.CLNT_OBJ_ID = ? AND t1.ROLL_13_MNTH_IND = ? AND t0.pers_obj_id IN ( SELECT t2.pers_obj_id FROM T_FACT_WORK_ASGNMT t2 WHERE (t2.CLNT_OBJ_ID = ? AND t3.MNTH_STRT_DAY_KY >= ?))) Notice that T_DIM_DAY is aliased twice. If the above JPQL string is used to create or run a query, the generated query is exactly like the above SQL, minus the 'T_DIM_DAY t3'. As can be seen, there is a different path when creating or running a query with a CriteriaBuilder as opposed to just a JPQL string.
Problem conclusion
With this fix, code has been added to OpenJPA to remove the duplicate alias. The fix for this APAR is currently targeted for inclusion in Service Levels 8.0.0.11 and 8.5.5.6 of WebSphere Application Server versions 8.0.0 and 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
PI37124
Reported component name
WEBSPHERE APP S
Reported component ID
5724J0800
Reported release
800
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2015-03-16
Closed date
2015-05-18
Last modified date
2015-05-18
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
R850 PSY
UP
Document Information
Modified date:
28 April 2022