if (isExtendingPessimisticLockScope(sourceQuery)) {
if (this.extendPessimisticLockScope == ExtendPessimisticLockScope.TARGET_QUERY) {
if (targetQuery == this.selectionQuery) {
// perf: bug#4751950, first prepare the query before cloning.
if (targetQuery.shouldPrepare()) {
targetQuery.checkPrepare(executionSession, row);
}
targetQuery = (ObjectLevelReadQuery)targetQuery.clone();
targetQuery.setIsExecutionClone(true);
}
extendPessimisticLockScopeInTargetQuery((ObjectLevelReadQuery)targetQuery, sourceQuery);