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
When using a fetch group with a JPQL query, only the fields in the fetch group are returned. However, any attempt to access an entiy field which is not in the fetch group, using its get method in the JPA entity, while it is still attached to the entity manager, does not result in a lazy fetch, but instead results in a null.
Local fix
NA
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 an OpenJPA FetchGroup. * **************************************************************** * PROBLEM DESCRIPTION: OpenJPA FetchGroup is not returning * * lazy fields. * **************************************************************** * RECOMMENDATION: * **************************************************************** There is an issue with FetchGroups not returning 'lazy' fields. To describe, take this entity: @Entity @FetchGroup(name = "HardwareSimple", attributes = { @FetchAttribute(name = "status"), @FetchAttribute(name = "statusActive") }) public class HardwareStatus implements Serializable { @Id private String status; private String statusActive; private String condition; private int connection; ............... With this Entity, take the following scenario: OpenJPAEntityManager openJpaEm = OpenJPAPersistence.cast(em); openJpaEm.getFetchPlan().resetFetchGroups().removeFetchGroup("de fault").addFetchGroups("HardwareSimple"); HardwareStatus h1 = em.find(HardwareStatus.class, "Lost"); //h1.status contains "Lost" in the db. assertEquals("Lost",h1.getStatus()); //this assert passes //h1.connection contains '2' in the db. assertEquals(2, h1.getConnection()); //this assert fails, 0 is returned by the getter. //h1.condition contains "Used" in the db. assertEquals("Used", h1.getCondition()); //this assert fails, null is returned by the getter. The latter two h1.get* do not return the correct values. These fields are 'lazy' (that is, not part of the FetchGroup) but should be fetched when requested.
Problem conclusion
With this fix, code has been added to OpenJPA to properly handle field which are part of a FetchGroup and defined as 'lazy'. The fix for this APAR is currently targeted for inclusion in Service Levels (Fix Packs) 8.0.0.11, 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
PI29412
Reported component name
WEBS APP SERV N
Reported component ID
5724H8800
Reported release
800
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2014-11-11
Closed date
2015-03-02
Last modified date
2015-03-02
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
R800 PSY
UP
R850 PSY
UP
Document Information
Modified date:
28 April 2022