/** * INTERNAL: * ObjectLevelReadQueries now have an explicit pre-prepare stage, which * is for checking for pessimistic locking, and computing any joined * attributes declared on the descriptor. */ protected void checkPrePrepare(AbstractSession session) { // This query is first prepared for global common state, this must be synced. if (!this.isPrePrepared) {// Avoid the monitor is already prePrepare, must check again for concurrency. synchronized (this) { if (!isPrePrepared()) { AbstractSession alreadySetSession = getSession(); setSession(session);// Session is required for some init stuff. prePrepare(); setSession(alreadySetSession); setIsPrePrepared(true);// MUST not set prepare until done as other thread may hit before finishing the prePrepare. } } } else { // Must always check descriptor as transient for remote. checkDescriptor(session); } }
if (!isPrePrepared()) { AbstractSession alreadySetSession = getSession(); setSession(session);// Session is required for some init stuff. prePrepare(); setSession(alreadySetSession); setIsPrePrepared(true);// MUST not set prepare until done as other thread may hit before finishing the prePrepare.
if (!isPrePrepared()) { AbstractSession alreadySetSession = getSession(); setSession(session);// Session is required for some init stuff. prePrepare(); setSession(alreadySetSession); setIsPrePrepared(true);// MUST not set prepare until done as other thread may hit before finishing the prePrepare.
nestedQuery.setSession(executionSession); return nestedQuery; nestedQuery = prepareNestedJoins(joinManager, sourceQuery, executionSession); nestedQuery.setSession(executionSession);
nestedQuery.setSession(executionSession); nestedQuery.setPrefetchedCacheKeys(sourceQuery.getPrefetchedCacheKeys()); return nestedQuery; nestedQuery = prepareNestedJoins(joinManager, sourceQuery, executionSession); nestedQuery.setSession(executionSession);
nestedQuery.setSession(executionSession); nestedQuery.setPrefetchedCacheKeys(sourceQuery.getPrefetchedCacheKeys()); return nestedQuery; nestedQuery = prepareNestedJoins(joinManager, sourceQuery, executionSession); nestedQuery.setSession(executionSession);
setSession(nestedUnitOfWork.getParent()); Object result = executeDatabaseQuery(); setSession(nestedUnitOfWork); return registerResultInUnitOfWork(result, nestedUnitOfWork, getTranslationRow(), false);
setSession(nestedUnitOfWork.getParent()); Object result = executeDatabaseQuery(); setSession(nestedUnitOfWork); return registerResultInUnitOfWork(result, nestedUnitOfWork, getTranslationRow(), false);
setSession(nestedUnitOfWork.getParent()); Object result = executeDatabaseQuery(); setSession(nestedUnitOfWork); return registerResultInUnitOfWork(result, nestedUnitOfWork, getTranslationRow(), false);
nestedQuery.setSession(session); nestedQuery.getJoinedAttributeManager().computeJoiningMappingQueries(session); nestedQuery.setSession(null);
nestedQuery.setSession(session); nestedQuery.setShouldUseSerializedObjectPolicy(baseQuery.shouldUseSerializedObjectPolicy()); nestedQuery.getJoinedAttributeManager().computeJoiningMappingQueries(session); nestedQuery.setSession(null); nestedQuery.setRequiresDeferredLocks(baseQuery.requiresDeferredLocks());
nestedQuery.setSession(session); nestedQuery.setShouldUseSerializedObjectPolicy(baseQuery.shouldUseSerializedObjectPolicy()); nestedQuery.getJoinedAttributeManager().computeJoiningMappingQueries(session); nestedQuery.setSession(null); nestedQuery.setRequiresDeferredLocks(baseQuery.requiresDeferredLocks());