Fixes are available
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
Client is trying to force an eager fetch on a query. They are using OpenJPAs FetchPlan to do so. Here s how they are doing it: (as per documentation FetchPlan fetchPlan = query.unwrap(OpenJPAQuery.class).getFetchPlan(); fetchPlan.addField(Compra.class, "apostador"); On the first time the query is executed, it works as expected. However, on the second time the same query is executed, and the result comes from OpenJPA s cache, it doesn t work. The relationship attribute comes as null. not the Query s FetchPlan), it works as expected: it is always eagerly fetched. See the example below: FetchPlan fetchPlan = getEntityManager().unwrap(OpenJPAEntityManager. class).getFetchPlan(); fetchPlan.addField(Compra.class, "apostador");
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 OpenJPA QueryCache and FetchPlans. * **************************************************************** * PROBLEM DESCRIPTION: Incorrect JPA relationship data * * returned when QueryCache and * * FetchPlans are used. * **************************************************************** * RECOMMENDATION: * **************************************************************** A scenario exist where incorrect data is returned when the DataCache, QueryCache, and FetchPlans are used. To explain, take these very simple entities and relationship: @Entity public class Entity1 { @Id private int id; @OneToOne(fetch = FetchType.LAZY) private Entity2 ent2; ........ @Entity public class Entity2 { @Id private Long id; ...... Given these two entities, take this scenario: Query q = em.createQuery("Select e1 from Entity1 e1"); FetchPlan fetchPlan = q.unwrap(OpenJPAQuery.class).getFetchPlan(); fetchPlan.addField(Entity1.class, "ent2"); List<Entity1> results = (List<Entity1>) q.getResultList(); em.clear(); assertNotNull("No results returned!", results); for (Entity1 e1 : results) { assertNotNull("An 'Entity2' should have been returned!", e1.getEnt2()); } With this code, assume the DataCache and QueryCache are both enabled, and assume there is an Entity1 with an Entity2 in the database. When we run this code all works fine. However, if we run the code back to back using the same EntityManagerFactory, an Entity1 will be returned but its Entity2 will be null! If on the other hand, we run the code 3 times in a row, where there is a time lag between the 2nd and 3rd execution greater than the DataCache timeout, the correct data will be returned during the 3rd run.
Problem conclusion
With this fix, code has been added to OpenJPA to ensure that the proper relationship data is returned when QueryCache and FetchPlans are used. The fix for this APAR is currently targeted for inclusion in Service Levels (Fix Packs) 8.0.0.12 and 8.5.5.8 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
PI44859
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-07-13
Closed date
2015-10-16
Last modified date
2015-10-16
APAR is sysrouted FROM one or more of the following:
PI41046
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:
27 April 2022