/** * INTERNAL: * Execute the query. If there are cached results return those. * This must override the super to support result caching. * * @param session the session in which the receiver will be executed. * @return An object or vector, the result of executing the query. * @exception DatabaseException - an error has occurred on the database */ public Object execute(AbstractSession session, AbstractRecord row) throws DatabaseException { if (shouldCacheQueryResults()) { if (shouldConformResultsInUnitOfWork()) { throw QueryException.cannotConformAndCacheQueryResults(this); } if (isPrepared()) {// only prepared queries can have cached results. Object result = getQueryResults(session, row, true); // Bug6138532 - if result is "cached no results", return null immediately if (result == InvalidObject.instance) { return null; } if (result != null) { if (session.isUnitOfWork()) { result = ((UnitOfWorkImpl)session).registerExistingObject(result); } return result; } } } return super.execute(session, row); }
/** * INTERNAL: * Execute the query. If there are cached results return those. * This must override the super to support result caching. * * @param session the session in which the receiver will be executed. * @return An object or vector, the result of executing the query. * @exception DatabaseException - an error has occurred on the database */ public Object execute(AbstractSession session, AbstractRecord row) throws DatabaseException { if (shouldCacheQueryResults()) { if (shouldConformResultsInUnitOfWork()) { throw QueryException.cannotConformAndCacheQueryResults(this); } if (isPrepared()) {// only prepared queries can have cached results. Object result = getQueryResults(session, row, true); // Bug6138532 - if result is "cached no results", return null immediately if (result == InvalidObject.instance) { return null; } if (result != null) { if (session.isUnitOfWork()) { result = ((UnitOfWorkImpl)session).registerExistingObject(result); } return result; } } } return super.execute(session, row); }
/** * INTERNAL: * Execute the query. If there are cached results return those. * This must override the super to support result caching. * * @param session the session in which the receiver will be executed. * @return An object or vector, the result of executing the query. * @exception DatabaseException - an error has occurred on the database */ public Object execute(AbstractSession session, AbstractRecord row) throws DatabaseException { if (shouldCacheQueryResults()) { if (shouldConformResultsInUnitOfWork()) { throw QueryException.cannotConformAndCacheQueryResults(this); } if (isPrepared()) {// only prepared queries can have cached results. Object result = getQueryResults(session, row, true); // Bug6138532 - if result is "cached no results", return null immediately if (result == InvalidObject.instance) { return null; } if (result != null) { if (session.isUnitOfWork()) { result = ((UnitOfWorkImpl)session).registerExistingObject(result); } return result; } } } return super.execute(session, row); }
throw QueryException.cannotConformAndCacheQueryResults(this);
throw QueryException.cannotConformAndCacheQueryResults(this);
throw QueryException.cannotConformAndCacheQueryResults(this);