| Modifier and Type | Class and Description |
|---|---|
| private static class | GenericStatementContext.
This is a TimerTask that is responsible for timing out statements, typically when an application has called Statement.setQueryTimeout(). |
| Modifier and Type | Field and Description |
|---|---|
| private Activation | activation
The activation associated with this context, or null |
| private volatile boolean | |
| private GenericStatementContext. | |
| private ArrayList | |
| private String | |
| private boolean | |
| private boolean | |
| private boolean | |
| private boolean | |
| private final LanguageConnectionContext | |
| private NoPutResultSet[] | |
| private boolean | |
| private ParameterValueSet | |
| private boolean | |
| private boolean | |
| private short | sqlAllowed
Set to one of RoutineAliasInfo.{MODIFIES_SQL_DATA, READS_SQL_DATA, CONTAINS_SQL, NO_SQL} |
| private SQLSessionContext | sqlSessionContext
The SQLSessionContext associated with a statement context. |
| private boolean | |
| private String | |
| private NoPutResultSet[] | |
| private ResultSet |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | addDependency(Dependency
The dependency to track. dy)Implements org. Track a Dependency within this StatementContext. |
| public StringBuffer | |
| public void | cancel()
Implements org. Cancels the statement which has allocated this StatementContext object. |
| public void | cleanupOnError(Throwable
The original error error)Implements org. Close down the top ResultSet, if relevant, and rollback to the internal savepoint, if one was set. |
| public void | clearInUse()
Implements org. Mark this context as not in use. |
| public void | clearSavePoint()
Implements org. Clear the save point for the current statement. |
| public Activation | getActivation()
Implements org. Get activation associated with this statement context, if any. |
| public short | getSQLAllowed()
Implements org. Get the setting of the SQL allowed state. |
| public SQLSessionContext | getSQLSessionContext()
Implements org. Get the current SQL session context. |
| public String | Returns: the statement textImplements org. Return the text of the current statement. |
| public boolean | getStatementWasInvalidated()
Implements org. Tells if this statement has been invalidated. |
| public NoPutResultSet[] | Returns: NoPutResultSet[] The (sparse) array of tops of subquery ResultSet treesImplements org. Get the subquery tracking array for this query. |
| public boolean | getSystemCode()
Implements org. Return true if this statement is system code. |
| private static TimerFactory | |
| public boolean | Returns: true if we are in a trigger contextImplements org. Returns whether we started from within the context of a trigger or not. |
| public boolean | inUse()
Implements org. Is this statement context in use or not. |
| public boolean | Returns: true if needs to be atomicImplements org. 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 | Returns: whether the statement which has allocated this StatementContext object has been cancelled.Implements org. Tests whether the statement which has allocated this StatementContext object has been cancelled. |
| public boolean | isForReadOnly()
Implements org. Is this statement for a read only, non-updatable ResultSet |
| public boolean | isLastHandler(int
The severity level severity)Overrides org. Implements org. Return whether or not this context is the "last" handler for a the specified severity level. |
| public boolean | Returns: true if this StatementContext is on the context stack. false otherwise.Implements org. Reports whether this StatementContext is on the context stack. |
| private void | |
| public void | resetSavePoint()
Implements org. Resets the savepoint to the current spot if it is set, otherwise, noop. |
| public void | setActivation(Activation
activation a)Implements org. Mark this statement context as associated with this activation. |
| public void | setInUse(boolean
true if the parent started in the context of a trigger parentInTrigger, boolean true if the statement must be executed
atomically isAtomic, boolean true if the statement is for producing non-updatable
resultset isForReadOnly, String the text of the statement. Needed for any language
statement (currently, for any statement that can cause a trigger
to fire). Please set this unless you are some funky jdbc setXXX
method or something. stmtText, ParameterValueSet parameter value set, if it has one pvs, long timeout value for the statement, in milliseconds.
Zero means no timeout. timeoutMillis)Implements org. Mark this context as being in use. |
| public void | setParentRollback()
Implements org. 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 | setSavePoint()
Implements org. Set a save point for the current statement. |
| public void | setSQLAllowed(short allow, boolean
set to true to override more restrictive setting. Used to
reset the permissions after a function call. force)Implements org. Set the level of SQL allowed in this and subsequent nested statements due to a routine call. |
| public void | setSQLSessionContext(SQLSessionContext
the SQL session context ctx)Implements org. Set the current SQL session context |
| public void | setSubqueryResultSet(int
The subquery # for this subquery subqueryNumber, NoPutResultSet The ResultSet at the top of the subquery subqueryResultSet, int The total # of subqueries in the entire query numSubqueries)Implements org. Set the appropriate entry in the subquery tracking array for the specified subquery. |
| public void | setSystemCode()
Implements org. Set to indicate statement is system code. |
| public void | setTopResultSet(ResultSet
The top ResultSet in the ResultSet tree topResultSet, NoPutResultSet[] (Sparse) of tops of subquery ResultSet trees subqueryTrackingArray)Implements org. Set the top ResultSet in the ResultSet tree for close down on an error. |
| private void | stuffTopResultSet(ResultSet
make this the top result set topResultSet, NoPutResultSet[] where to keep track of subqueries in this statement subqueryTrackingArray)Private minion of setTopResultSet() and clearInUse() |
| activation | back to summary |
|---|---|
| private Activation activation The activation associated with this context, or null | |
| cancellationFlag | back to summary |
|---|---|
| private volatile boolean cancellationFlag | |
| cancelTask | back to summary |
|---|---|
| private GenericStatementContext. | |
| dependencies | back to summary |
|---|---|
| private ArrayList<Dependency> dependencies | |
| internalSavePointName | back to summary |
|---|---|
| private String internalSavePointName | |
| inUse | back to summary |
|---|---|
| private boolean inUse | |
| isAtomic | back to summary |
|---|---|
| private boolean isAtomic | |
| isForReadOnly | back to summary |
|---|---|
| private boolean isForReadOnly | |
| isSystemCode | back to summary |
|---|---|
| private boolean isSystemCode | |
| lcc | back to summary |
|---|---|
| private final LanguageConnectionContext lcc | |
| materializedSubqueries | back to summary |
|---|---|
| private NoPutResultSet[] materializedSubqueries | |
| parentInTrigger | back to summary |
|---|---|
| private boolean parentInTrigger | |
| pvs | back to summary |
|---|---|
| private ParameterValueSet pvs | |
| rollbackParentContext | back to summary |
|---|---|
| private boolean rollbackParentContext | |
| setSavePoint | back to summary |
|---|---|
| private boolean setSavePoint | |
| sqlAllowed | back to summary |
|---|---|
| private short sqlAllowed Set to one of RoutineAliasInfo.{MODIFIES_SQL_DATA, READS_SQL_DATA, CONTAINS_SQL, NO_SQL} | |
| sqlSessionContext | back to summary |
|---|---|
| private SQLSessionContext sqlSessionContext The SQLSessionContext associated with a statement context. | |
| statementWasInvalidated | back to summary |
|---|---|
| private boolean statementWasInvalidated | |
| stmtText | back to summary |
|---|---|
| private String stmtText | |
| subqueryTrackingArray | back to summary |
|---|---|
| private NoPutResultSet[] subqueryTrackingArray | |
| topResultSet | back to summary |
|---|---|
| private ResultSet topResultSet | |
| GenericStatementContext | back to summary |
|---|---|
| pack-priv GenericStatementContext(LanguageConnectionContext lcc) | |
| addDependency | back to summary |
|---|---|
| public void addDependency(Dependency dy) throws StandardException Implements org. Track a Dependency within this StatementContext. (We need to clear any dependencies added within this context on an error.
| |
| appendErrorInfo | back to summary |
|---|---|
| public StringBuffer appendErrorInfo() Overrides org. | |
| cancel | back to summary |
|---|---|
| public void cancel() Implements org. 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 | back to summary |
|---|---|
| public void cleanupOnError(Throwable error) throws StandardException Implements org. Close down the top ResultSet, if relevant, and rollback to the internal savepoint, if one was set.
| |
| clearInUse | back to summary |
|---|---|
| public void clearInUse() Implements org. Doc from org. Mark this context as not in use. This is important because we always leave the top statement context on the stack, and we don't want to clean it up if a statement level exception happens while the context is not in use. | |
| clearSavePoint | back to summary |
|---|---|
| public void clearSavePoint() throws StandardException Implements org. Doc from org. Clear the save point for the current statement.
| |
| getActivation | back to summary |
|---|---|
| public Activation getActivation() Implements org. Doc from org. Get activation associated with this statement context, if any. Used to link up stack of activations of calls in nested connections, see GenericPreparedStatement#getActivation.
| |
| getSQLAllowed | back to summary |
|---|---|
| public short getSQLAllowed() Implements org. Doc from org. Get the setting of the SQL allowed state. | |
| getSQLSessionContext | back to summary |
|---|---|
| public SQLSessionContext getSQLSessionContext() Implements org. Doc from org. Get the current SQL session context.
| |
| getStatementText | back to summary |
|---|---|
| public String getStatementText() Implements org. 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.
| |
| getStatementWasInvalidated | back to summary |
|---|---|
| public boolean getStatementWasInvalidated() Implements org. Doc from org. Tells if this statement has been invalidated.
| |
| getSubqueryTrackingArray | back to summary |
|---|---|
| public NoPutResultSet[] getSubqueryTrackingArray() throws StandardException Implements org. Get the subquery tracking array for this query. (Useful for runtime statistics.)
| |
| getSystemCode | back to summary |
|---|---|
| public boolean getSystemCode() Implements org. Return true if this statement is system code. | |
| getTimerFactory | back to summary |
|---|---|
| private static TimerFactory getTimerFactory() | |
| inTrigger | back to summary |
|---|---|
| public boolean inTrigger() Implements org. Returns whether we started from within the context of a trigger or not.
| |
| inUse | back to summary |
|---|---|
| public boolean inUse() Implements org. Doc from org. Is this statement context in use or not.
| |
| isAtomic | back to summary |
|---|---|
| public boolean isAtomic() Implements org. 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.
| |
| isCancelled | back to summary |
|---|---|
| public boolean isCancelled() Implements org. 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.
| |
| isForReadOnly | back to summary |
|---|---|
| public boolean isForReadOnly() Implements org. Doc from org. Is this statement for a read only, non-updatable ResultSet
| |
| isLastHandler | back to summary |
|---|---|
| public boolean isLastHandler(int severity) Overrides org. Implements org. Doc from org. Return whether or not this context is the "last" handler for a the specified severity level. Previously, the context manager would march through all of the contexts in cleanupOnError() and call each of their cleanupOnError() methods. That did not work with server side JDBC, especially for a StatementException, because outer contexts could get cleaned up incorrectly. This functionality is specific to the Language system. Any non-language system contexts should return ExceptionSeverity.NOT_APPLICABLE_SEVERITY. Note Both the LanguageConnectionContext and the JDBC Connection Context are interested in session level errors because they both have clean up to do. This method allows both of them to return false so that all such handlers under them can do their clean up.
| |
| onStack | back to summary |
|---|---|
| public boolean onStack() Implements org. Reports whether this StatementContext is on the context stack.
| |
| pleaseBeOnStack | back to summary |
|---|---|
| private void pleaseBeOnStack() throws StandardException Raise an exception if this Context is not in use, that is, on the Context Stack.
| |
| resetSavePoint | back to summary |
|---|---|
| public void resetSavePoint() throws StandardException Implements org. Resets the savepoint to the current spot if it is set, otherwise, noop. Used when a commit is done on a nested connection.
| |
| setActivation | back to summary |
|---|---|
| public void setActivation(Activation a) Implements org. Doc from org. Mark this statement context as associated with this activation.
| |
| setInUse | back to summary |
|---|---|
| public void setInUse(boolean parentInTrigger, boolean isAtomic, boolean isForReadOnly, String stmtText, ParameterValueSet pvs, long timeoutMillis) Implements org. Doc from org. Mark this context as being in use.
| |
| setParentRollback | back to summary |
|---|---|
| public void setParentRollback() Implements org. 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. | |
| setSavePoint | back to summary |
|---|---|
| public void setSavePoint() throws StandardException Implements org. Doc from org. Set a save point for the current statement. Note This needs to be off of the StatementContext so that it gets cleared on a statement error.
| |
| setSQLAllowed | back to summary |
|---|---|
| public void setSQLAllowed(short allow, boolean force) Implements org. Doc from org. Set the level of SQL allowed in this and subsequent nested statements due to a routine call. Value must be one of RoutineAliasInfo.{MODIFIES_SQL_DATA, READS_SQL_DATA, CONTAINS_SQL, NO_SQL}
| |
| setSQLSessionContext | back to summary |
|---|---|
| public void setSQLSessionContext(SQLSessionContext ctx) Implements org. Doc from org. Set the current SQL session context
| |
| setSubqueryResultSet | back to summary |
|---|---|
| public void setSubqueryResultSet(int subqueryNumber, NoPutResultSet subqueryResultSet, int numSubqueries) throws StandardException Implements org. Set the appropriate entry in the subquery tracking array for the specified subquery. Useful for closing down open subqueries on an exception.
| |
| setSystemCode | back to summary |
|---|---|
| public void setSystemCode() Implements org. Set to indicate statement is system code. For example a system procedure, view, function etc. | |
| setTopResultSet | back to summary |
|---|---|
| public void setTopResultSet(ResultSet topResultSet, NoPutResultSet[] subqueryTrackingArray) throws StandardException Implements org. Set the top ResultSet in the ResultSet tree for close down on an error.
| |
| stuffTopResultSet | back to summary |
|---|---|
| private void stuffTopResultSet(ResultSet topResultSet, NoPutResultSet[] subqueryTrackingArray) Private minion of setTopResultSet() and clearInUse()
| |
| Modifier and Type | Field and Description |
|---|---|
| private StatementContext | statementContext
Reference to the StatementContext for the executing statement which might time out. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | run()
Implements abstract java. Implements java. Invoked by a Timer class to cancel an executing statement. |
| statementContext | back to summary |
|---|---|
| private StatementContext statementContext Reference to the StatementContext for the executing statement which might time out. | |
| CancelQueryTask | back to summary |
|---|---|
| public CancelQueryTask(StatementContext ctx) Initializes a new task for timing out a statement's execution. This does not schedule it for execution, the caller is responsible for calling Timer.schedule() with this object as parameter. | |
| forgetContext | back to summary |
|---|---|
| public void forgetContext() Stops this task and prevents it from cancelling a statement. Guarantees that after this method returns, the associated StatementContext object will not be tampered with by this task. Thus, the StatementContext object may safely be allocated to other executing statements. | |
| run | back to summary |
|---|---|
| public void run() Implements abstract java. Implements java. Invoked by a Timer class to cancel an executing statement. This method just sets a volatile flag in the associated StatementContext object by calling StatementContext.cancel(); it is the responsibility of the thread executing the statement to check this flag regularly. | |