| java.lang.Object org.apache.derby.iapi.services.context.ContextImpl org.apache.derby.impl.sql.conn.GenericStatementContext
GenericStatementContext | final class GenericStatementContext extends ContextImpl implements StatementContext(Code) | | GenericStatementContext is pushed/popped around a statement prepare and execute
so that any statement specific clean up can be performed.
author: jerry |
Method Summary | |
public void | addDependency(Dependency dy) Track a Dependency within this StatementContext. | public StringBuffer | appendErrorInfo() | public void | cancel() Cancels the statement which has allocated this StatementContext object.
This is done by setting a flag in the StatementContext object. | public void | cleanupOnError(Throwable error) Close down the top ResultSet, if relevant, and rollback to the
internal savepoint, if one was set.
exception: StandardException - thrown on error. | public void | clearInUse() | public void | clearSavePoint() | public short | getSQLAllowed() | public String | getStatementText() Return the text of the current statement.
Note that this may be null. | public NoPutResultSet[] | getSubqueryTrackingArray() Get the subquery tracking array for this query. | public boolean | getSystemCode() Return true if this statement is system code. | public boolean | inTrigger() Returns whether we started from within the context of a trigger
or not. | public boolean | inUse() | public boolean | isAtomic() Indicates whether the statement needs to be executed atomically
or not, i.e., whether a commit/rollback is permitted by a
connection nested in this statement. | public boolean | isCancelled() Tests whether the statement which has allocated this StatementContext
object has been cancelled. | public boolean | isForReadOnly() | public boolean | isLastHandler(int severity) | public boolean | onStack() Reports whether this StatementContext is on the context stack.
true if this StatementContext is on the context stack. | public void | resetSavePoint() Resets the savepoint to the current spot if it is
set, otherwise, noop. | public void | setInUse(boolean parentInTrigger, boolean isAtomic, boolean isForReadOnly, String stmtText, ParameterValueSet pvs, long timeoutMillis) | public void | setParentRollback() Indicate that, in the event of a statement-level exception,
this context is NOT the last one that needs to be rolled
back--rather, it is nested within some other statement
context, and that other context needs to be rolled back,
too. | public void | setSQLAllowed(short allow, boolean force) | public void | setSavePoint() | public void | setSubqueryResultSet(int subqueryNumber, NoPutResultSet subqueryResultSet, int numSubqueries) Set the appropriate entry in the subquery tracking array for
the specified subquery. | public void | setSystemCode() Set to indicate statement is system code. | public void | setTopResultSet(ResultSet topResultSet, NoPutResultSet[] subqueryTrackingArray) Set the top ResultSet in the ResultSet tree for close down on
an error. |
addDependency | public void addDependency(Dependency dy) throws StandardException(Code) | | Track a Dependency within this StatementContext.
(We need to clear any dependencies added within this
context on an error.
Parameters: dy - The dependency to track. exception: StandardException - thrown on error. |
cancel | public void cancel()(Code) | | Cancels the statement which has allocated this StatementContext object.
This is done by setting a flag in the StatementContext object. For
this to have any effect, it is the responsibility of the executing
statement to check this flag regularly.
|
cleanupOnError | public void cleanupOnError(Throwable error) throws StandardException(Code) | | Close down the top ResultSet, if relevant, and rollback to the
internal savepoint, if one was set.
exception: StandardException - thrown on error. REVISIT: don't wantcleanupOnError's to throw exceptions. |
clearInUse | public void clearInUse()(Code) | | |
getSQLAllowed | public short getSQLAllowed()(Code) | | |
getStatementText | public String getStatementText()(Code) | | Return the text of the current statement.
Note that this may be null. It is currently
not set up correctly for ResultSets that aren't
single row result sets (e.g SELECT), replication,
and setXXXX/getXXXX jdbc methods.
the statement text |
getSubqueryTrackingArray | public NoPutResultSet[] getSubqueryTrackingArray() throws StandardException(Code) | | Get the subquery tracking array for this query.
(Useful for runtime statistics.)
NoPutResultSet[] The (sparse) array of tops of subquery ResultSet trees exception: StandardException - thrown on error. |
getSystemCode | public boolean getSystemCode()(Code) | | Return true if this statement is system code.
|
inTrigger | public boolean inTrigger()(Code) | | Returns whether we started from within the context of a trigger
or not.
true if we are in a trigger context |
inUse | public boolean inUse()(Code) | | |
isAtomic | public boolean isAtomic()(Code) | | Indicates whether the statement needs to be executed atomically
or not, i.e., whether a commit/rollback is permitted by a
connection nested in this statement.
true if needs to be atomic |
isCancelled | public boolean isCancelled()(Code) | | Tests whether the statement which has allocated this StatementContext
object has been cancelled. This method is typically called from the
thread which is executing the statement, to test whether execution
should continue or stop.
whether the statement which has allocated this StatementContextobject has been cancelled. |
isForReadOnly | public boolean isForReadOnly()(Code) | | |
onStack | public boolean onStack()(Code) | | Reports whether this StatementContext is on the context stack.
true if this StatementContext is on the context stack. false otherwise. |
setInUse | public void setInUse(boolean parentInTrigger, boolean isAtomic, boolean isForReadOnly, String stmtText, ParameterValueSet pvs, long timeoutMillis)(Code) | | |
setParentRollback | public void setParentRollback()(Code) | | Indicate that, in the event of a statement-level exception,
this context is NOT the last one that needs to be rolled
back--rather, it is nested within some other statement
context, and that other context needs to be rolled back,
too.
|
setSQLAllowed | public void setSQLAllowed(short allow, boolean force)(Code) | | |
setSubqueryResultSet | public void setSubqueryResultSet(int subqueryNumber, NoPutResultSet subqueryResultSet, int numSubqueries) throws StandardException(Code) | | Set the appropriate entry in the subquery tracking array for
the specified subquery.
Useful for closing down open subqueries on an exception.
Parameters: subqueryNumber - The subquery # for this subquery Parameters: subqueryResultSet - The ResultSet at the top of the subquery Parameters: numSubqueries - The total # of subqueries in the entire query exception: StandardException - thrown on error. |
setSystemCode | public void setSystemCode()(Code) | | Set to indicate statement is system code.
For example a system procedure, view, function etc.
|
|
|