Object result = null; if (query.getAccessors().size() == 1) { result = query.getAccessor().executeCall(call, translationRow, this); } else { RuntimeException exception = null; Object object = null; try { object = accessor.executeCall(call, translationRow, this); } catch (RuntimeException failed) {
Object result = null; if (query.getAccessors().size() == 1) { result = query.getAccessor().executeCall(call, translationRow, this); } else { RuntimeException exception = null; Object object = null; try { object = accessor.executeCall(call, translationRow, this); } catch (RuntimeException failed) {
/** * INTERNAL: * Overridden by subclasses that do more than just execute the call. * Executes the call directly on this session and does not check which * session it should have executed on. */ public Object executeCall(Call call, AbstractRecord translationRow, DatabaseQuery query) throws DatabaseException { //** sequencing refactoring if (query.getAccessor() == null) { query.setAccessor(getAccessor()); } try { return query.getAccessor().executeCall(call, translationRow, this); } finally { if (call.isFinished()) { query.setAccessor(null); } } }
protected void buildAndExecuteCall(DatabaseCall dbCall, AbstractSession session) { DatabaseQuery query = dbCall.getQuery(); if (!query.isWriteObjectQuery()) { //if not writequery, should not go through the locator writing.. return; } WriteObjectQuery writeQuery = (WriteObjectQuery)query; writeQuery.setAccessor(accessor); //build a select statement form the query SQLSelectStatement selectStatement = buildSelectStatementForLocator(writeQuery, dbCall, session); //then build a call from the statement DatabaseCall call = buildCallFromSelectStatementForLocator(selectStatement, writeQuery, dbCall, session); accessor.executeCall(call, call.getQuery().getTranslationRow(), session); }
protected void buildAndExecuteCall(DatabaseCall dbCall, AbstractSession session) { DatabaseQuery query = dbCall.getQuery(); if (!query.isWriteObjectQuery()) { //if not writequery, should not go through the locator writing.. return; } WriteObjectQuery writeQuery = (WriteObjectQuery)query; writeQuery.setAccessor(accessor); //build a select statement form the query SQLSelectStatement selectStatement = buildSelectStatementForLocator(writeQuery, dbCall, session); //then build a call from the statement DatabaseCall call = buildCallFromSelectStatementForLocator(selectStatement, writeQuery, dbCall, session); accessor.executeCall(call, call.getQuery().getTranslationRow(), session); }
protected void buildAndExecuteCall(DatabaseCall dbCall, AbstractSession session) { DatabaseQuery query = dbCall.getQuery(); if (!query.isWriteObjectQuery()) { //if not writequery, should not go through the locator writing.. return; } WriteObjectQuery writeQuery = (WriteObjectQuery)query; writeQuery.setAccessor(accessor); //build a select statement form the query SQLSelectStatement selectStatement = buildSelectStatementForLocator(writeQuery, dbCall, session); //then build a call from the statement DatabaseCall call = buildCallFromSelectStatementForLocator(selectStatement, writeQuery, dbCall, session); accessor.executeCall(call, call.getQuery().getTranslationRow(), session); }
object = query.getAccessor().executeCall(call, translationRow, this); } catch (RuntimeException caughtException) { exception = caughtException;
/** * INTERNAL: * Override From session. Get the accessor based on the query, and execute call, * this is here for session broker. */ public Object executeCall(Call call, AbstractRecord translationRow, DatabaseQuery query) throws DatabaseException { Accessor accessor; if (query.getSessionName() == null) { accessor = query.getSession().getAccessor(query.getReferenceClass()); } else { accessor = query.getSession().getAccessor(query.getSessionName()); } query.setAccessor(accessor); try { return query.getAccessor().executeCall(call, translationRow, this); } finally { if (call.isFinished()) { query.setAccessor(null); } } }
/** * INTERNAL: * Override to acquire the connection from the pool at the last minute */ public Object executeCall(Call call, AbstractRecord translationRow, DatabaseQuery query) throws DatabaseException { if (query.getAccessor() == null) { //if the connection has not yet been acquired then do it here. if (getAccessor() == null) { this.parent.acquireClientConnection(this); } query.setAccessor(getAccessor()); } try { return query.getAccessor().executeCall(call, translationRow, this); } finally { if (call.isFinished()) { query.setAccessor(null); } if(!isActive() && getAccessor() != null) { // the session has been already released and this query is likely instantiates a ValueHolder - // release exclusive connection right away, otherwise it may never be released. this.parent.releaseClientSession(this); } } }