/** * INTERNAL: * Check to see if this query needs to be prepare and prepare it. * The prepare is done on the original query to ensure that the work is not repeated. */ @Override public void checkPrepare(AbstractSession session, AbstractRecord translationRow, boolean force) { // CR#3823735 For custom queries the prePrepare may not have been called yet. if (!this.isPrePrepared || (this.descriptor == null)) { checkPrePrepare(session); } super.checkPrepare(session, translationRow, force); }
/** * ADVANCED: * Answers if this query will issue any pessimistic locks. * <p> * If the lock mode is not known (DEFAULT_LOCK_MODE / descriptor specified * fine-grained locking) the lock mode will be determined now, to be either * LOCK, LOCK_NOWAIT, or NO_LOCK. * @see #isLockQuery() */ public boolean isLockQuery(org.eclipse.persistence.sessions.Session session) { checkPrePrepare((AbstractSession)session); return isLockQuery(); }
/** * INTERNAL: * Check to see if this query needs to be prepare and prepare it. * The prepare is done on the original query to ensure that the work is not repeated. */ @Override public void checkPrepare(AbstractSession session, AbstractRecord translationRow, boolean force) { // CR#3823735 For custom queries the prePrepare may not have been called yet. if (!this.isPrePrepared || (this.descriptor == null)) { checkPrePrepare(session); } super.checkPrepare(session, translationRow, force); }
/** * ADVANCED: * Answers if this query will issue any pessimistic locks. * <p> * If the lock mode is not known (DEFAULT_LOCK_MODE / descriptor specified * fine-grained locking) the lock mode will be determined now, to be either * LOCK, LOCK_NOWAIT, or NO_LOCK. * @see #isLockQuery() */ public boolean isLockQuery(org.eclipse.persistence.sessions.Session session) { checkPrePrepare((AbstractSession)session); return isLockQuery(); }
/** * INTERNAL: * Check to see if this query needs to be prepare and prepare it. * The prepare is done on the original query to ensure that the work is not repeated. */ public void checkPrepare(AbstractSession session, AbstractRecord translationRow, boolean force) { // CR#3823735 For custom queries the prePrepare may not have been called yet. checkPrePrepare(session); super.checkPrepare(session, translationRow, force); }
/** * ADVANCED: * Answers if this query will issue any pessimistic locks. * <p> * If the lock mode is not known (DEFAULT_LOCK_MODE / descriptor specified * fine-grained locking) the lock mode will be determined now, to be either * LOCK, LOCK_NOWAIT, or NO_LOCK. * @see #isLockQuery() */ public boolean isLockQuery(org.eclipse.persistence.sessions.Session session) { checkPrePrepare((AbstractSession)session); return isLockQuery(); }
/** * INTERNAL: * Prepare the receiver for execution in a session. */ @Override protected void prepareForRemoteExecution() throws QueryException { super.prepareForRemoteExecution(); checkPrePrepare(getSession()); prepareQuery(); }
/** * INTERNAL: * Prepare the receiver for execution in a session. */ @Override protected void prepareForRemoteExecution() throws QueryException { super.prepareForRemoteExecution(); checkPrePrepare(getSession()); prepareQuery(); }
/** * INTERNAL: * Prepare the receiver for execution in a session. */ protected void prepareForRemoteExecution() throws QueryException { super.prepareForRemoteExecution(); checkPrePrepare(getSession()); prepareQuery(); }
/** * INTERNAL: * There is a very special case where a query may be a bean-level * pessimistic locking query. * <p> * If that is so, only queries executed inside of a UnitOfWork should * have a locking clause. In the extremely rare case that we execute * a locking query outside of a UnitOfWork, must disable locking so that * we do not get a fetch out of sequence error. */ public DatabaseQuery prepareOutsideUnitOfWork(AbstractSession session) { // Implementation is complicated because: if locking refresh will be // auto set to true preventing cache hit. // Must prepare this query from scratch if outside uow but locking // Must not reprepare this query as a NO_LOCK, but create a clone first // Must not cloneAndUnPrepare unless really have to if (isLockQuery(session) && getLockingClause().isForUpdateOfClause()) { ObjectLevelReadQuery clone = (ObjectLevelReadQuery)clone(); clone.setIsExecutionClone(true); clone.dontAcquireLocks(); clone.setIsPrepared(false); clone.checkPrePrepare(session); return clone; } return this; }
/** * INTERNAL: * There is a very special case where a query may be a bean-level * pessimistic locking query. * <p> * If that is so, only queries executed inside of a UnitOfWork should * have a locking clause. In the extremely rare case that we execute * a locking query outside of a UnitOfWork, must disable locking so that * we do not get a fetch out of sequence error. */ public DatabaseQuery prepareOutsideUnitOfWork(AbstractSession session) { // Implementation is complicated because: if locking refresh will be // auto set to true preventing cache hit. // Must prepare this query from scratch if outside uow but locking // Must not reprepare this query as a NO_LOCK, but create a clone first // Must not cloneAndUnPrepare unless really have to if (isLockQuery(session) && getLockingClause().isForUpdateOfClause()) { ObjectLevelReadQuery clone = (ObjectLevelReadQuery)clone(); clone.setIsExecutionClone(true); clone.dontAcquireLocks(); clone.setIsPrepared(false); clone.checkPrePrepare(session); return clone; } return this; }
/** * INTERNAL: * There is a very special case where a query may be a bean-level * pessimistic locking query. * <p> * If that is so, only queries executed inside of a UnitOfWork should * have a locking clause. In the extremely rare case that we execute * a locking query outside of a UnitOfWork, must disable locking so that * we do not get a fetch out of sequence error. */ public DatabaseQuery prepareOutsideUnitOfWork(AbstractSession session) { // Implementation is complicated because: if locking refresh will be // auto set to true preventing cache hit. // Must prepare this query from scratch if outside uow but locking // Must not reprepare this query as a NO_LOCK, but create a clone first // Must not cloneAndUnPrepare unless really have to if (isLockQuery(session) && getLockingClause().isForUpdateOfClause()) { ObjectLevelReadQuery clone = (ObjectLevelReadQuery)clone(); clone.setIsExecutionClone(true); clone.dontAcquireLocks(); clone.setIsPrepared(false); clone.checkPrePrepare(session); return clone; } return this; }
((ObjectLevelReadQuery)this).checkPrePrepare(session); } else { checkDescriptor(session);
((ObjectLevelReadQuery)this).checkPrePrepare(session); } else { checkDescriptor(session);