James,
Your change done to ExpressionQueryMechanism.java in revision 1442 seems
to have broken checkCacheForObject against UnitOfWork instance if object only exist
in Session cache and shouldCheckCacheOnly is true.
Our existing unit test passing against TopLink 10.x is now failing with
EclipseLink.
The first assert pass but not the second.
assertTrue(uow.getParent().getIdentityMapAccessor().isValid(timecardOldUOW));
ReadObjectQuery readObjectQuery = new ReadObjectQuery(clazz);
readObjectQuery.setCacheUsage(ReadObjectQuery.CheckCacheOnly);
readObjectQuery.setSelectionKey(getKeyFrom(timecardOldUOW));
assertNotNull(uow.executeQuery(readObjectQuery));
Because new code will return InvalidObject,
code below will skip trying to read from session cache:
public Object checkEarlyReturn(AbstractSession session, AbstractRecord
translationRow) {
// For bug 3136413/2610803 building
the selection criteria from an EJBQL string or
// an example object is done just in
time.
// Also calls checkDescriptor here.
//buildSelectionCriteria(session);
checkPrePrepare(session);
if (!session.isUnitOfWork()) {
return
checkEarlyReturnImpl(session, translationRow);
}
UnitOfWorkImpl unitOfWork
= (UnitOfWorkImpl)session;
// The cache check must happen on the
UnitOfWork in these cases either
// to access transient state or for
pessimistic locking, as only the
// UOW knows which objects it has
locked.
Object
result = checkEarlyReturnImpl(unitOfWork, translationRow);
if (result != null) {
return
result;
}
https://bugs.eclipse.org/bugs/show_bug.cgi?id=233247
http://fisheye2.atlassian.com/browse/eclipselink/trunk/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/queries/ExpressionQueryMechanism.java?r=1442