Queries Returning Incorrect Data With Toplink 12 - Worked Fine With Toplink 10.1.3.4
(Doc ID 1900004.1)
Last updated on MARCH 14, 2019
Applies to:Oracle TopLink - Version 126.96.36.199.0 and later
Information in this document applies to any platform.
Toplink queries not returning the correct data in the current version of Toplink. The functionality worked correctly in Toplink 10.1.3.4.
This issue stopped working when upgrading to Toplink 12.
Here is technical summary of the issue extracted from the bug Test Case
The line that states 'Retrieving children by Parent IDFR:' is printed
right before the TstChild object is retrieved from the database based on its
After both TstChild objects are retrieved, the TstParent object is
obtained through the one-to-one mapping back to the parent. The parent
idfr is then compared to the idfr that is passed in as an argument
to the query.
When using TopLink 10g we see that the TstChild retrieved always
matches the expected one. However, when using TopLink 12c the
second TstChild retrieved is the same one as the first one retrieved.
Note: InMemoryQueryIndirectionPolicy is configured to throw an indirection exception
Stepping through the EclipseLink code it looks like in
while checking the cache on the second query that there is code present that
if 'Conform Results in Unit of Work' is enabled and the
InMemoryQueryIndirectionPolicy is not
SHOULD_TRIGGER_INDIRECTION it changes the policy to
Eventually IdentityMapManager.getFromIdentityMap is invoked where it attempts
go through the elements in the cache looking for the element in the query.
doesConform against the already read back TstChild object a
exception is thrown (since the TstChild.getParent() method has not yet been
invoked initializing the Value
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!
In this Document