|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.wgen.op.db.CallExecutorDB
Executes DatabaseCalls against a database.
During normal operations this CallExecutor is instantiated by the DirectOpExecutor. The connection used in the CallExecutor is intentionally hidden and unreachable. If there is a specific need to gain access to the connection, you should look into using the HandlingOptions and providing something you can set using the DatabaseCall.setOptions().
DirectOpExecutor.executeOp(net.wgen.op.Op)| Field Summary | |
private MappedConnectionFactory |
_cxFactory
Provides connections to the DB. |
static java.lang.String |
CONTEXT_TAG
Used for HandlingOption pre and post call methods. |
private static int |
ORACLE_PACKAGE_STATE_ERROR
Oracle error associated with recompiling package bodies. |
| Constructor Summary | |
CallExecutorDB(MappedConnectionFactory cxFactory)
Default constructor requires a factory to provide database connections. |
|
| Method Summary | |
void |
executeDatabaseCall(DatabaseCall dbCall)
Executes an operation described by the DatabaseCall and registers that operations output in the appropriate parameter objects in the DatabaseCall. |
void |
executeOp(Op op)
Executes another op. |
java.util.Collection |
executeQueryWithResultSet(DatabaseCall dbCall)
Executes an operation described by the DatabaseCall and returns the Collection representing the data returned by the PreparedStatement in the ResultSet. |
void |
executeUpdate(DatabaseCall dbCall)
Runs a call against the database using the executeUpdate method of PreparedStatement. |
private boolean |
isOraclePackageStateError(DatabaseCall dbCall,
java.lang.Exception ex)
Whether or not this error was a package state error caused by the recompiling of a database package. |
protected DatabaseCallException |
makeDatabaseCallException(DatabaseCall dbCall,
java.lang.Exception ex)
Make a DatabaseCallException out of an exception. |
protected void |
processCompletionInfo(DatabaseCall dbCall,
long t1,
long t2,
java.lang.String amountOfWork)
Called in the finally block of a call execution, this method adds information to the trace key and handles the call to the WebAppStats and the app log. |
protected void |
processPostCallOptions(DatabaseCall dbCall)
Called at the end of the finally statement to process any options that should be evaluated after everything is called. |
protected void |
processPreCallOptions(DatabaseCall dbCall)
Copies options from the DatabaseCall's opOwner, and invokes HandlingOption preCall() on any registered HandlingOption keys. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String CONTEXT_TAG
processPreCallOptions(DatabaseCall),
processPostCallOptions(DatabaseCall),
Constant Field Valuesprivate static final int ORACLE_PACKAGE_STATE_ERROR
executeDatabaseCall(DatabaseCall),
isOraclePackageStateError(DatabaseCall, Exception),
Constant Field Valuesprivate final MappedConnectionFactory _cxFactory
| Constructor Detail |
public CallExecutorDB(MappedConnectionFactory cxFactory)
cxFactory - the factory that will provide the connections| Method Detail |
public void executeOp(Op op)
throws OpException
executeOp in interface CallExecutorop - the op to be executed
OpExceptionOpUtils.runOp(net.wgen.op.Op, CallExecutor)
public void executeDatabaseCall(DatabaseCall dbCall)
throws DatabaseCallException
executeDatabaseCall in interface CallExecutordbCall - the object describing the operation to be performed
DatabaseCallException
public java.util.Collection executeQueryWithResultSet(DatabaseCall dbCall)
throws DatabaseCallException
executeQueryWithResultSet in interface CallExecutordbCall - the object describing the operation to be run
DatabaseCallException
public void executeUpdate(DatabaseCall dbCall)
throws DatabaseCallException
executeUpdate in interface CallExecutordbCall - the call to run
DatabaseCallExceptionprotected void processPreCallOptions(DatabaseCall dbCall)
dbCall - the call about to be executedHandlingOption.preCall(String, DatabaseCall)protected void processPostCallOptions(DatabaseCall dbCall)
dbCall - the call being finishedHandlingOption.postCall(String, DatabaseCall)
protected void processCompletionInfo(DatabaseCall dbCall,
long t1,
long t2,
java.lang.String amountOfWork)
dbCall - t1 - the start time of the callt2 - the end time of the call (after call and processing of outputs)amountOfWork - a characterization of the amount of work done in handling the
call's outputs which generally is the number of rows returned
protected DatabaseCallException makeDatabaseCallException(DatabaseCall dbCall,
java.lang.Exception ex)
dbCall - the statement being executed when the error was encounteredex - the exception that occurred
private boolean isOraclePackageStateError(DatabaseCall dbCall,
java.lang.Exception ex)
ex - the exception to evaluate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||