Class GenericLanguageConnectionContext
- All Implemented Interfaces:
Context, LanguageConnectionContext
The generic impl does not provide statement caching.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ArrayList<Activation> private ArrayList<TempTableInfo> private ASTVisitorprotected Authorizerprivate HashMap<String, AutoincrementCounter> To support lastAutoincrementValue: This is a hashtable which maps schemaName,tableName,columnName to a Long value.private booleanwhether to allow updates or not.protected intprivate SchemaDescriptorUsed to hold the computed value of the initial default schema, cf logic in initDefaultSchemaDescriptor.protected LanguageConnectionFactoryprivate intprotected DataValueFactoryprivate Databaseprivate Stringprivate booleanprivate intThe set of disk backed hash tables containing any index rows saved for deferred constraints in this transaction, keyed by the conglomerate id.private Stringprivate booleanprivate longprivate final intprivate StandardExceptionInterrupt status flag of this session's thread, in the form of an exception created where an interrupt was (last) detected during operation, null if no interrupt has been seen.protected intprivate booleanprivate booleanprivate HeaderPrintWriterprotected LanguageFactoryprivate Objectprivate intprivate booleanprivate booleanprivate intThe maximum size of acts since the last time it was trimmed.protected longprotected intprivate static final intprotected OptimizerFactoryprivate OptTraceprotected intprotected intThis holds a map of AST nodes that have already been printed during a compiler phase, so as to be able to avoid printing a node more than once.private intqueryNestingDepth is a counter used to keep track of how many calls have been made to begin read-only nested transactions.private TransactionControllerIf non-null indicates that a read-only nested user transaction is in progress.private WeakHashMap<TableDescriptor, FormatableBitSet> Connection local state for cachedTableDescriptors used for keeping track of referenced columns for a table during DDL operations.private RunTimeStatisticsprivate booleanprivate StringBufferprivate StringIn contrast to current user id, which may change (inside a routine executing with definer's rights), the sessionUser is constant in a session.private final StatementContext[]private intprivate booleanprivate ArrayList<ExecutionStmtValidator> protected TypeCompilerFactoryprivate SQLSessionContextThe top SQL session context stack frame (SQL 2003, section 4.37.3), is kept in topLevelSSC.private final TransactionControllerThe transaction to use within this language connection context.private ArrayList<TriggerExecutionContext> private ArrayList<TableDescriptor> private booleanprotected Stringprivate static final intprivate static final intprivate Stringthe current xplain schema.For each XPLAIN table, this map stores a SQL INSERT statement which can be prepared and used to insert rows into the table during the capturing of statistics data into the user XPLAIN tables.private booleanIf xplainOnlyMode is set (via SYSCS_SET_XPLAIN_MODE), then the connection does not actually execute statements, but only compiles them, and emits the query plan information into the XPLAIN tables.Fields inherited from interface LanguageConnectionContext
ANSI_CASING, ANTI_ANSI_CASING, CONTEXT_ID, dbnameStr, drdaStr, lccStr, MULTI_TRANSACTION_LOCK, NO_SCHEMAS, OUTERMOST_STATEMENT, SINGLE_TRANSACTION_LOCK, SQL92_SCHEMAS, UNKNOWN_CASING, USER_NAME_SCHEMA, xidStr -
Constructor Summary
ConstructorsConstructorDescriptionGenericLanguageConnectionContext(ContextManager cm, TransactionController tranCtrl, LanguageFactory lf, LanguageConnectionFactory lcf, Database db, String userName, int instanceNumber, String drdaID, String dbname) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the activation to those known about by this connection.voidAdd the declared global temporary table to the list of temporary tables known by this connection.voidautoincrementCreateCounter(String s, String t, String c, Long initialValue, long increment, int position) Create an autoincrement counter to be used on behalf of a SQL-J statement.voidautoincrementFlushCache(UUID tableUUID) Flush the cache of autoincrement values being kept by the lcc.voidbeginNestedTransaction(boolean readOnly) Start a Nested User Transaction (NUT) with the store.private booleancheckIfAnyActivationHasHoldCursor(String tableName) check if there are any activations that reference this temporary tablebooleanCheck if there are any global temporary tables declared for this connection.voidCheck that deferred constraints are valid, if not roll back the transaction.voidcleanupOnError(Throwable error) If worse than a transaction error, everything goes; we rely on other contexts to kill the context manager for this session.private TableDescriptorcleanupTempTableOnCommitOrRollback(TableDescriptor td, boolean dropAndRedeclare) If dropAndRedeclare is true, that means we have come here for temp tables with on commit delete rows and no held curosr open on them.private voidClear deferred information for this transaction.voidClose any unused activations in this connection context.voidcommit a nested transaction.private voidcompareConstraintModes(SQLSessionContext nested, SQLSessionContext caller) voidcopyHashtableToAIHT(Map<String, Long> from) Copies an existing autoincrement mapping into autoincrementHT, the cache of autoincrement values kept in the languageconnectioncontext.Create a fresh SQLSessionContext for this connection.final booleanReturn true if the data dictionary is in write mode (that is, this context was informed that is is in write mode by the method call setDataDictionaryWriteMode().intDecrement the DataDictionary bind count.private voidDecrements the statement depthprotected voiddoCommit(boolean commitStore, boolean sync, int commitflag, boolean requestedByUser) This is where the work on internalCommit(), userCOmmit() and internalCommitNoSync() actually takes place.private voiddoRollback(boolean xa, boolean requestedByUser) When a rollback happens, the language connection context will close all open activations and invalidate their prepared statements.private voidDrop all the declared global temporary tables associated with this connection.booleandropDeclaredGlobalTempTable(String tableName) Drop (mark the declared global temporary table for dropping) from the list of temporary tables known by this connection.private voidendTransactionActivationHandling(boolean forRollback) If we are called as part of rollback code path, then we will reset all the activations that have resultset returning rows associated with them.private TempTableInfofindDeclaredGlobalTempTable(String tableName) Find the declared global temporary table in the list of temporary tables known by this connection.private voidFinish the data dictionary transaction, if any.intReturn the number of activations known for this connection.Get the Visitor which should walk the AST.Get an Authorizer for this connection.booleanReturns the current value of autoincrementUpdate.intGet the DataDictionary bind count.intGet the current isolation level.Get the current isolation level in DB2 format.Get the current role authorization identifier of the dynamic call context associated with this activation.Get the current role authorization identifier in external delimited form (not case normal form) of the dynamic call context associated with this activation.Get the current schema name (at compile-time, see explanations for getDefaultSchema overloads).Get the current schema name (at execution time, see explanations for getDefaultSchema overloads); This version is used by CURRENT SCHEMA.private SQLSessionContextReturn the current SQL session context based on statement contextgetCurrentSQLSessionContext(Activation activation) Return the current SQL session context of the activationGet the Authorization Id of the current userReturns the Database of this connection.Get the data dictionaryGet the data value factory to use with this language connection context.Get the database name of this LCC.Get the default schema (used at compile-time when no activation is yet available, cf. the activation argument overload version.Get the default schema (used at execution time).Get the set of disk backed hash tables containing any index rows saved for deferred unique/PK constraints in this transaction, keyed by the conglomerate id, or rows saved containing row locations violating rows for deferred check constraints.Get the DRDA ID of this LCC.Get the identity column value most recently generated.private SchemaDescriptorGet the computed value for the initial default schema.intGet the instance number of this LCC.Get exception created when we detected interruped status flag.Get the language connection factory to use with this language connection context.Get the language factory to use with this language connection context.Return the last activation added This is used to find the drop activation in dropViewCascade so we can add warning messages to the activationDebug method for retrieving the last query tree.intget the lock escalation threshold.booleanGet value of logQueryPlan.booleanGet value of logStatementText.private StringgetNameString(String prefix, long number) Build a String for a statement name.get the optimizer factory to use with this language connection context.Get the optimizer tracer (could be null if we aren't tracing the optimizer).intGet the prepare isolation level.Return a map of AST nodes that have already been printed during a compiler phase, so as to be able to avoid printing a node more than once.Get the referenced column map for a tablebooleanGet the RUNTIMESTATISTICS mode.Get the RUNTIMESTATISTICS object.Get the session userGet the current StatementContext.intReports how many statement levels deep we are.booleanGet the STATISTICS TIMING mode.Get table descriptor for the declared global temporary table from the list of temporary tables known by this connection.Get the value of top level session context of the top level connection.final TransactionControllerGet the transaction controller to use at compile time with this language connection context.Get the transaction controller to use with this language connection context during execute time.Get the topmost tec.Get the topmost trigger table descriptorGet a connection unique system generated name for a cursor.intGet a connection unique system generated id for an unnamed savepoint.Get a connection unique system generated name for an unnamed savepoint.booleangets the current set XplainOnlyModegets the current set XplainSchemagetXplainStatement(Object key) intIncrement the DataDictionary bind count.private voidIncrements the statement depth.protected SchemaDescriptorCompute the initial default schema and set cachedInitialDefaultSchemaDescr accordingly.voidInitialize.voidinternalCommit(boolean commitStore) Do a commit as appropriate for an internally generated commit (e.g. as needed by sync, or autocommit).final voidinternalCommitNoSync(int commitflag) Commit the language transaction by doing a commitNoSync() on the store's TransactionController.voidDo a rollback as appropriate for an internally generated rollback (e.g. as needed by sync, or autocommit).voidinternalRollbackToSavepoint(String savepointName, boolean refreshStyle, Object kindOfSavepoint) Let the context deal with a rollback to savepointprivate voidInvalidate a dropped temp tablebooleanisEffectivelyDeferred(SQLSessionContext sc, UUID constraintId) Determines if a check or foreign key constraint has deferred mode.booleanisInitialDefaultSchema(String schemaName) Return true if this schema name is the initial default schema for the current session.booleanReturns true if isolation level has been set using JDBC/SQL.booleanisLastHandler(int severity) Return whether or not this context is the "last" handler for a the specified severity level.booleanGet the readOnly status for the current connection.booleanReports whether there is any outstanding work in the transaction.voidlanguageSetSavePoint(String savepointName, Object kindOfSavepoint) Sets a savepoint.lastAutoincrementValue(String schemaName, String tableName, String columnName) lastAutoincrementValue searches for the last autoincrement value inserted into a column specified by the user.lookupCursorActivation(String cursorName) See if a given cursor is available for use. if so return its activation.lookupStatement(GenericStatement statement) See if a given statement has already been compiled for this user, and if so use its prepared statement.voidmarkTempTableAsModifiedInUnitOfWork(String tableName) Mark the passed temporary table as modified in the current unit of work.longnextAutoincrementValue(String schemaName, String tableName, String columnName) returns the next value to be inserted into an autoincrement col.voidMake a note that some activations are marked unusedbooleanGet whether or not optimizer trace is on.voidPop a CompilerContext off the context stack.voidpopExecutionStmtValidator(ExecutionStmtValidator validator) Remove the validator.voidIf returning from a routine that can execute SQL, perform any actions needed when popping the SQL session context.voidpopStatementContext(StatementContext statementContext, Throwable error) Pop a StatementContext of the context stack.voidRemove the tec.voidRemove the trigger table descriptor.prepareInternalStatement(String sqlText) Return a PreparedStatement object for the query.prepareInternalStatement(SchemaDescriptor compilationSchema, String sqlText, boolean isForReadOnly, boolean forMetaData) Return a PreparedStatement object for the query.final CompilerContextPush a CompilerContext on the context stack with the current default schema as the default schema which we compile against.Push a CompilerContext on the context stack with the passed in schema sd as the default schema we compile against.voidpushExecutionStmtValidator(ExecutionStmtValidator validator) Push a new execution statement validator.voidpushNestedSessionContext(Activation a, boolean definersRights, String definer) Create a new SQL session context for the current activation on the basis of the existing SQL session context.pushStatementContext(boolean isAtomic, boolean isForReadOnly, String stmtText, ParameterValueSet pvs, boolean rollbackParentContext, long timeoutMillis) Push a StatementContext on the context stack.voidPush a new trigger execution context.voidSet the trigger table descriptor.voidreleaseSavePoint(String savepointName, Object kindOfSavepoint) Let the context deal with a release of a savepointvoidRemove the activation to those known about by this connection.voidremoveStatement(GenericStatement statement) This method will remove a statement from the statement cache.private voidreplaceDeclaredGlobalTempTable(String tableName, TableDescriptor td) This is called at the commit time for temporary tables with ON COMMIT DELETE ROWS If a temp table with ON COMMIT DELETE ROWS doesn't have any held cursor open on them, we delete the data from them by dropping the conglomerate and recreating the conglomerate.voidReset the connection before it is returned (indirectly) by a PooledConnection object.voidReset the isolation level flag used to keep correct isolation level state in BrokeredConnection.private voidReset all statement savepoints.voidresetSchemaUsages(Activation activation, String schemaName) Reset any occurence of schemaName as current default schema in the SQLSessionContext stack to the initial default, because schemaName is no longer a valid schema.protected voidResets the statementDepth.booleanroleIsSettable(Activation a, String role) Checks whether the given role can be legally set for the current user.voidsetASTVisitor(ASTVisitor visitor) Set a Visitor which walks the AST at various stages.voidsetAutoincrementUpdate(boolean flag) Sets autoincrementUpdate-- this variable allows updates to autoincrement columns if it is set to true.voidsetConstraintDeferred(Activation a, ConstraintDescriptor cd, boolean deferred) Set the constraint mode to deferred for the specified constraint.voidsetCurrentRole(Activation a, String role) Set the current rolefinal voidRemember that the DataDictionary is in write mode, so we can take it out of write mode at the end of the transaction.voidSet the default schema (at execution time, see explanations for getDefaultSchema overloads); This version is used by SET SCHEMA.voidSet the default schema (at compile-time, see explanations for getDefaultSchema overloads).voidsetDeferredAll(Activation a, boolean deferred) Set the constraint mode of all deferrable constraints to the value ofdeferred.voidSet the DRDA ID of this LCC.voidsetIdentityValue(long val) Set the field of most recently generated identity column value.voidSet the exception created and associated with the detected interruped status flag.voidsetIsolationLevel(int isolationLevel) Set current isolation level.voidsetLastQueryTree(Object queryTree) Debug method for remembering the last query tree.voidsetLogStatementText(boolean logStatementText) Set value of logStatementText (Whether or not to write info on currently executing statement to error log.)voidsetOptimizerTracer(OptTrace tracer) Install an optimizer tracer (to enable tracing) or uninstall the current optimizer tracer (to disable tracing).voidsetPrepareIsolationLevel(int level) voidsetReadOnly(boolean on) Set the readOnly status for the current connection.voidSet the referenced column map for a tablefinal voidsetRunTimeStatisticsMode(boolean onOrOff) Turn RUNTIMESTATISTICS on or off.voidsetRunTimeStatisticsObject(RunTimeStatistics runTimeStatisticsObject) Set the RUNTIMESTATISTICS object.voidsetStatisticsTiming(boolean onOrOff) Turn STATISTICS TIMING on or off.private voidsetupSessionContextMinion(Activation a, boolean push, boolean definersRights, String definer) voidUsed when a statement as part of its operation executes an other statement.voidsetXplainOnlyMode(boolean onOrOff) sets the XplainOnlyMode.voidsets the XplainSchemavoidsetXplainStatement(Object key, Object stmt) private voidtempTablesAndCommit(boolean in_xa_transaction) Do the necessary work at commit time for temporary tablesprivate voiddo the necessary work at rollback time for temporary tables 1)If a temp table was declared in the UOW, then drop it and remove it from list of temporary tables. 2)If a temp table was declared and dropped in the UOW, then remove it from list of temporary tables. 3)If an existing temp table was dropped in the UOW, then recreate it with no data. 4)If an existing temp table was modified in the UOW, then get rid of all the rows from the table.private voidAfter a release of a savepoint, we need to go through our temp tables list.private voidvoidDo a commmit as is appropriate for a user requested commit (e.g. a java.sql.Connection.commit() or a language 'COMMIT' statement.voidDo a rollback as is appropriate for a user requested rollback (e.g. a java.sql.Connection.rollback() or a language 'ROLLBACk' statement.booleanCheck if in SQL standard mode, with support for Grant and Revokeprivate voidValidate a deferred constraint.private voidvalidateDeferredConstraints(boolean rollbackOnError) Validate all deferred constraints.voidvalidateStmtExecution(ConstantAction constantAction) Validate a statement.booleanVerify that there are no activations with open held result sets.booleanverifyNoOpenResultSets(PreparedStatement pStmt, Provider provider, int action) Verify that there are no activations with open result sets on the specified prepared statement.final voidxaCommit(boolean onePhase) Same as userCommit except commit a distributed transaction.voidSame as userRollback() except rolls back a distrubuted transaction.Methods inherited from class ContextImpl
getContextManager, getIdName, popMe, pushMeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Context
getContextManager, getIdName, popMe, pushMe
-
Field Details
-
NON_XA
private static final int NON_XA- See Also:
-
XA_ONE_PHASE
private static final int XA_ONE_PHASE- See Also:
-
XA_TWO_PHASE
private static final int XA_TWO_PHASE- See Also:
-
acts
-
unusedActs
private volatile boolean unusedActs -
maxActsSize
private int maxActsSizeThe maximum size of acts since the last time it was trimmed. Used to determine whether acts should be trimmed to reclaim space. -
bindCount
protected int bindCount -
ddWriteMode
private boolean ddWriteMode -
runTimeStatisticsSetting
private boolean runTimeStatisticsSetting -
statisticsTiming
private boolean statisticsTiming -
xplainOnlyMode
private boolean xplainOnlyModeIf xplainOnlyMode is set (via SYSCS_SET_XPLAIN_MODE), then the connection does not actually execute statements, but only compiles them, and emits the query plan information into the XPLAIN tables. -
xplain_schema
the current xplain schema. Is usually NULL. Can be set via SYSCS_SET_XPLAIN_SCHEMA, in which case it species the schema into which XPLAIN information should be stored in user tables. -
xplain_statements
-
allDeclaredGlobalTempTables
-
currentSavepointLevel
private int currentSavepointLevel -
nextCursorId
protected long nextCursorId -
nextSavepointId
protected int nextSavepointId -
runTimeStatisticsObject
-
sb
-
db
-
instanceNumber
private final int instanceNumber -
drdaID
-
dbname
-
lastQueryTree
-
tran
The transaction to use within this language connection context. It may be more appropriate to have it in a separate context (LanguageTransactionContext?). REVISIT (nat): I shoehorned the transaction context that the language uses into this class. The main purpose is so that the various language code can find out what its transaction is. -
readOnlyNestedTransaction
If non-null indicates that a read-only nested user transaction is in progress. -
queryNestingDepth
private int queryNestingDepthqueryNestingDepth is a counter used to keep track of how many calls have been made to begin read-only nested transactions. Only the first call actually starts a Nested User Transaction with the store. Subsequent calls simply increment this counter. commitNestedTransaction only decrements the counter and when it drops to 0 actually commits the nested user transaction. -
dataFactory
-
langFactory
-
tcf
-
of
-
connFactory
-
statementContexts
-
statementDepth
private int statementDepth -
outermostTrigger
protected int outermostTrigger -
authorizer
-
userName
-
topLevelSSC
The top SQL session context stack frame (SQL 2003, section 4.37.3), is kept in topLevelSSC. For nested session contexts, the SQL session context is held by the activation of the calling statement, cf. pushNestedSessionContext and it is accessible through the current statement context (compile-time), or via the current activation (execution-time).- See Also:
-
cachedInitialDefaultSchemaDescr
Used to hold the computed value of the initial default schema, cf logic in initDefaultSchemaDescriptor. -
defaultIsolationLevel
private int defaultIsolationLevel -
isolationLevel
protected int isolationLevel -
isolationLevelExplicitlySet
private boolean isolationLevelExplicitlySet -
isolationLevelSetUsingSQLorJDBC
private boolean isolationLevelSetUsingSQLorJDBC -
prepareIsolationLevel
protected int prepareIsolationLevel -
logStatementText
private boolean logStatementText -
logQueryPlan
private boolean logQueryPlan -
istream
-
lockEscalationThreshold
private int lockEscalationThreshold -
stmtValidators
-
triggerExecutionContexts
-
triggerTables
-
optimizerTracer
-
autoincrementHT
-
autoincrementUpdate
private boolean autoincrementUpdatewhether to allow updates or not. -
identityVal
private long identityVal -
identityNotNull
private boolean identityNotNull -
autoincrementCacheHashtable
-
astWalker
-
interruptedException
Interrupt status flag of this session's thread, in the form of an exception created where an interrupt was (last) detected during operation, null if no interrupt has been seen. -
referencedColumnMap
Connection local state for cachedTableDescriptors used for keeping track of referenced columns for a table during DDL operations. -
deferredHashTables
The set of disk backed hash tables containing any index rows saved for deferred constraints in this transaction, keyed by the conglomerate id. Checked at commit time, then discarded. -
sessionUser
In contrast to current user id, which may change (inside a routine executing with definer's rights), the sessionUser is constant in a session. -
printedObjectsMap
-
-
Constructor Details
-
GenericLanguageConnectionContext
public GenericLanguageConnectionContext(ContextManager cm, TransactionController tranCtrl, LanguageFactory lf, LanguageConnectionFactory lcf, Database db, String userName, int instanceNumber, String drdaID, String dbname) throws StandardException - Throws:
StandardException
-
-
Method Details
-
initialize
Description copied from interface:LanguageConnectionContextInitialize. For use after pushing the contexts that initialization needs.- Specified by:
initializein interfaceLanguageConnectionContext- Throws:
StandardException- thrown if something goes wrong
-
initDefaultSchemaDescriptor
Compute the initial default schema and set cachedInitialDefaultSchemaDescr accordingly.- Returns:
- computed initial default schema value for this session
- Throws:
StandardException
-
getInitialDefaultSchemaDescriptor
Get the computed value for the initial default schema.- Returns:
- the schema descriptor of the computed initial default schema
-
getLogStatementText
public boolean getLogStatementText()Description copied from interface:LanguageConnectionContextGet value of logStatementText. (Whether or not to write info on currently executing statement to error log.)- Specified by:
getLogStatementTextin interfaceLanguageConnectionContext- Returns:
- value of logStatementText
- See Also:
-
setLogStatementText
public void setLogStatementText(boolean logStatementText) Description copied from interface:LanguageConnectionContextSet value of logStatementText (Whether or not to write info on currently executing statement to error log.)- Specified by:
setLogStatementTextin interfaceLanguageConnectionContext- Parameters:
logStatementText- Whether or not logStatementText property is set.- See Also:
-
getLogQueryPlan
public boolean getLogQueryPlan()Description copied from interface:LanguageConnectionContextGet value of logQueryPlan. (Whether or not to write query plan info on currently executing statement to error log.)- Specified by:
getLogQueryPlanin interfaceLanguageConnectionContext- Returns:
- value of logQueryPlan
- See Also:
-
usesSqlAuthorization
public boolean usesSqlAuthorization()Description copied from interface:LanguageConnectionContextCheck if in SQL standard mode, with support for Grant and Revoke- Specified by:
usesSqlAuthorizationin interfaceLanguageConnectionContext- Returns:
- True if SQL standard permissions are being used
- See Also:
-
getLockEscalationThreshold
public int getLockEscalationThreshold()get the lock escalation threshold.- Specified by:
getLockEscalationThresholdin interfaceLanguageConnectionContext
-
addActivation
Add the activation to those known about by this connection.- Specified by:
addActivationin interfaceLanguageConnectionContext- Throws:
StandardException
-
closeUnusedActivations
Description copied from interface:LanguageConnectionContextClose any unused activations in this connection context.- Specified by:
closeUnusedActivationsin interfaceLanguageConnectionContext- Throws:
StandardException
-
notifyUnusedActivation
public void notifyUnusedActivation()Make a note that some activations are marked unused- Specified by:
notifyUnusedActivationin interfaceLanguageConnectionContext
-
checkIfAnyDeclaredGlobalTempTablesForThisConnection
public boolean checkIfAnyDeclaredGlobalTempTablesForThisConnection()Description copied from interface:LanguageConnectionContextCheck if there are any global temporary tables declared for this connection.- Specified by:
checkIfAnyDeclaredGlobalTempTablesForThisConnectionin interfaceLanguageConnectionContext- Returns:
- true if there are declared temp tables for this connectoin else false
- See Also:
-
addDeclaredGlobalTempTable
Description copied from interface:LanguageConnectionContextAdd the declared global temporary table to the list of temporary tables known by this connection.- Specified by:
addDeclaredGlobalTempTablein interfaceLanguageConnectionContext- Parameters:
td- Corresponding to the temporary table- Throws:
StandardException- See Also:
-
dropDeclaredGlobalTempTable
Description copied from interface:LanguageConnectionContextDrop (mark the declared global temporary table for dropping) from the list of temporary tables known by this connection.- Specified by:
dropDeclaredGlobalTempTablein interfaceLanguageConnectionContext- Parameters:
tableName- look for this table name in the saved list and drop it if found- Returns:
- true if dropped the temporary table. False if no such temporary table exists.
- See Also:
-
tempTablesReleaseSavepointLevels
private void tempTablesReleaseSavepointLevels()After a release of a savepoint, we need to go through our temp tables list. If there are tables with their declare or drop or modified in savepoint levels set to savepoint levels higher than the current savepoint level, then we should change them to the current savepoint level -
tempTablesAndCommit
Do the necessary work at commit time for temporary tables1)If a temporary table was marked as dropped in this transaction, then remove it from the list of temp tables for this connection 2)If a temporary table was not dropped in this transaction, then mark it's declared savepoint level and modified savepoint level as -1 3)After savepoint fix up, then handle all ON COMMIT DELETE ROWS with no open held cursor temp tables.
- Parameters:
in_xa_transaction- if true, then transaction is an XA transaction, and special nested transaction may be necessary to cleanup internal containers supporting the temp tables at commit time.- Throws:
StandardException- Standard exception policy.
-
tempTablesXApostCommit
- Throws:
StandardException
-
resetFromPool
Reset the connection before it is returned (indirectly) by a PooledConnection object. See EmbeddedConnection.- Specified by:
resetFromPoolin interfaceLanguageConnectionContext- Throws:
StandardException
-
setLastQueryTree
Description copied from interface:LanguageConnectionContextDebug method for remembering the last query tree.- Specified by:
setLastQueryTreein interfaceLanguageConnectionContext
-
getLastQueryTree
Description copied from interface:LanguageConnectionContextDebug method for retrieving the last query tree.- Specified by:
getLastQueryTreein interfaceLanguageConnectionContext
-
dropAllDeclaredGlobalTempTables
Drop all the declared global temporary tables associated with this connection. This gets called when a getConnection() is done on a PooledConnection. This will ensure all the temporary tables declared on earlier connection handle associated with this physical database connection are dropped before a new connection handle is issued on that same physical database connection.- Throws:
StandardException
-
tempTablesAndRollback
do the necessary work at rollback time for temporary tables 1)If a temp table was declared in the UOW, then drop it and remove it from list of temporary tables. 2)If a temp table was declared and dropped in the UOW, then remove it from list of temporary tables. 3)If an existing temp table was dropped in the UOW, then recreate it with no data. 4)If an existing temp table was modified in the UOW, then get rid of all the rows from the table.- Throws:
StandardException
-
invalidateCleanupDroppedTable
Invalidate a dropped temp table- Throws:
StandardException
-
replaceDeclaredGlobalTempTable
This is called at the commit time for temporary tables with ON COMMIT DELETE ROWS If a temp table with ON COMMIT DELETE ROWS doesn't have any held cursor open on them, we delete the data from them by dropping the conglomerate and recreating the conglomerate. In order to store the new conglomerate information for the temp table, we need to replace the existing table descriptor with the new table descriptor which has the new conglomerate information- Parameters:
tableName- Temporary table name whose table descriptor is getting changedtd- New table descriptor for the temporary table
-
getTableDescriptorForDeclaredGlobalTempTable
Description copied from interface:LanguageConnectionContextGet table descriptor for the declared global temporary table from the list of temporary tables known by this connection.- Specified by:
getTableDescriptorForDeclaredGlobalTempTablein interfaceLanguageConnectionContext- Parameters:
tableName- Get table descriptor for the passed table name- Returns:
- TableDescriptor if found the temporary table. Else return null
- See Also:
-
findDeclaredGlobalTempTable
Find the declared global temporary table in the list of temporary tables known by this connection.- Parameters:
tableName- look for this table name in the saved list- Returns:
- data structure defining the temporary table if found. Else, return null
-
markTempTableAsModifiedInUnitOfWork
Description copied from interface:LanguageConnectionContextMark the passed temporary table as modified in the current unit of work. That information will be used at rollback time The compile phase will generate code to call this method if the DML is on a temporary table- Specified by:
markTempTableAsModifiedInUnitOfWorkin interfaceLanguageConnectionContext- Parameters:
tableName- Mark the passed temporary table name as modified- See Also:
-
prepareInternalStatement
public PreparedStatement prepareInternalStatement(SchemaDescriptor compilationSchema, String sqlText, boolean isForReadOnly, boolean forMetaData) throws StandardException Description copied from interface:LanguageConnectionContextReturn a PreparedStatement object for the query. This method first tries to locate the PreparedStatement object from a statement cache. If the statement is not found in the cache, the query will be compiled and put into the cache.- Specified by:
prepareInternalStatementin interfaceLanguageConnectionContext- Parameters:
compilationSchema- schemasqlText- sql query stringisForReadOnly- read only status for resultset. Set to true if the concurrency mode for the resultset is CONCUR_READ_ONLYforMetaData- If true, then this query is allowed to use internal sql syntax. One instance where this will be true is if a metadata query is getting executed.- Throws:
StandardException- See Also:
-
prepareInternalStatement
Description copied from interface:LanguageConnectionContextReturn a PreparedStatement object for the query. This method first tries to locate the PreparedStatement object from a statement cache. If the statement is not found in the cache, the query will be compiled and put into the cache. The schema used when compiling the statement is the same schema as returned by getDefaultSchema(). For internal statements, the read only status is set to true. Calling this method is equivalent to calling prepareExternalStatement(lcc.getDefaultSchema(), sqlText, true);- Specified by:
prepareInternalStatementin interfaceLanguageConnectionContext- Parameters:
sqlText- sql query string- Throws:
StandardException- See Also:
-
removeActivation
Remove the activation to those known about by this connection.- Specified by:
removeActivationin interfaceLanguageConnectionContext
-
getActivationCount
public int getActivationCount()Return the number of activations known for this connection. Note that some of these activations may not be in use (when a prepared statement is finalized, its activations are marked as unused and later closed and removed on the next commit/rollback).- Specified by:
getActivationCountin interfaceLanguageConnectionContext
-
lookupCursorActivation
See if a given cursor is available for use. if so return its activation. Returns null if not found. For use in execution.- Specified by:
lookupCursorActivationin interfaceLanguageConnectionContext- Returns:
- the activation for the given cursor, null if none was found.
-
removeStatement
This method will remove a statement from the statement cache. It should only be called if there is an exception preparing the statement. The caller must have set the flagpreparedStmt.compilingStatementin theGenericStatementbefore calling this method in order to prevent race conditions when callingCacheManager.remove(Cacheable).- Parameters:
statement- Statement to remove- Throws:
StandardException- thrown if lookup goes wrong.
-
lookupStatement
See if a given statement has already been compiled for this user, and if so use its prepared statement. Returns null if not found.- Returns:
- the prepared statement for the given string, null if none was found.
- Throws:
StandardException- thrown if lookup goes wrong.
-
getUniqueCursorName
Get a connection unique system generated name for a cursor.- Specified by:
getUniqueCursorNamein interfaceLanguageConnectionContext
-
getUniqueSavepointName
Get a connection unique system generated name for an unnamed savepoint.- Specified by:
getUniqueSavepointNamein interfaceLanguageConnectionContext
-
getUniqueSavepointID
public int getUniqueSavepointID()Get a connection unique system generated id for an unnamed savepoint.- Specified by:
getUniqueSavepointIDin interfaceLanguageConnectionContext
-
getNameString
-
internalCommit
Do a commit as appropriate for an internally generated commit (e.g. as needed by sync, or autocommit).- Specified by:
internalCommitin interfaceLanguageConnectionContext- Parameters:
commitStore- true if we should commit the Store transaction- Throws:
StandardException- thrown on failure
-
userCommit
Do a commmit as is appropriate for a user requested commit (e.g. a java.sql.Connection.commit() or a language 'COMMIT' statement. Does some extra checking to make sure that users aren't doing anything bad.- Specified by:
userCommitin interfaceLanguageConnectionContext- Throws:
StandardException- thrown on failure
-
internalCommitNoSync
Commit the language transaction by doing a commitNoSync() on the store's TransactionController.Do *NOT* tell the data dictionary that the transaction is finished. The reason is that this would allow other transactions to see comitted DDL that could be undone in the event of a system crash.
- Specified by:
internalCommitNoSyncin interfaceLanguageConnectionContext- Parameters:
commitflag- the flags to pass to commitNoSync in the store's TransactionController- Throws:
StandardException- thrown on failure
-
xaCommit
Same as userCommit except commit a distributed transaction. This commit always commit store and sync the commit.- Specified by:
xaCommitin interfaceLanguageConnectionContext- Parameters:
onePhase- if true, allow it to commit without first going thru a prepared state.- Throws:
StandardException- thrown if something goes wrong
-
doCommit
protected void doCommit(boolean commitStore, boolean sync, int commitflag, boolean requestedByUser) throws StandardException This is where the work on internalCommit(), userCOmmit() and internalCommitNoSync() actually takes place.When a commit happens, the language connection context will close all open activations/cursors and commit the Store transaction.
REVISIT: we talked about having a LanguageTransactionContext, but since store transaction management is currently in flux and our context might want to delegate to that context, for now all commit/rollback actions are handled directly by the language connection context. REVISIT: this may need additional alterations when RELEASE SAVEPOINT/ROLLBACK TO SAVEPOINT show up.
Since the access manager's own context takes care of its own resources on commit, and the transaction stays open, there is nothing that this context has to do with the transaction controller.
Also, tell the data dictionary that the transaction is finished, if necessary (that is, if the data dictionary was put into DDL mode in this transaction.
- Parameters:
commitStore- true if we should commit the Store transactionsync- true means do a synchronized commit, false means do an unsynchronized commitcommitflag- if this is an unsynchronized commit, the flags to pass to commitNoSync in the store's TransactionController. If this is a synchronized commit, this flag is overloaded for xacommit.requestedByUser- False iff the commit is for internal use and we should ignore the check to prevent commits in an atomic statement.- Throws:
StandardException- Thrown on error
-
cleanupTempTableOnCommitOrRollback
private TableDescriptor cleanupTempTableOnCommitOrRollback(TableDescriptor td, boolean dropAndRedeclare) throws StandardException If dropAndRedeclare is true, that means we have come here for temp tables with on commit delete rows and no held curosr open on them. We will drop the existing conglomerate and redeclare a new conglomerate similar to old conglomerate. This is a more efficient way of deleting all rows from the table. If dropAndRedeclare is false, that means we have come here for the rollback cleanup work. We are trying to restore old definition of the temp table (because the drop on it is being rolled back).- Throws:
StandardException
-
internalRollback
Do a rollback as appropriate for an internally generated rollback (e.g. as needed by sync, or autocommit). When a rollback happens, we close all open activations and invalidate their prepared statements. We then tell the cache to age out everything else, which effectively invalidates them. Thus, all prepared statements will be compiled anew on their 1st execution after a rollback.The invalidated statements can revalidate themselves without a full recompile if they verify their dependencies' providers still exist unchanged. REVISIT when invalidation types are created.
REVISIT: this may need additional alterations when RELEASE SAVEPOINT/ROLLBACK TO SAVEPOINT show up.
Also, tell the data dictionary that the transaction is finished, if necessary (that is, if the data dictionary was put into DDL mode in this transaction.
- Specified by:
internalRollbackin interfaceLanguageConnectionContext- Throws:
StandardException- thrown on failure
-
userRollback
Do a rollback as is appropriate for a user requested rollback (e.g. a java.sql.Connection.rollback() or a language 'ROLLBACk' statement. Does some extra checking to make sure that users aren't doing anything bad.- Specified by:
userRollbackin interfaceLanguageConnectionContext- Throws:
StandardException- thrown on failure
-
xaRollback
Same as userRollback() except rolls back a distrubuted transaction.- Specified by:
xaRollbackin interfaceLanguageConnectionContext- Throws:
StandardException- thrown if something goes wrong
-
doRollback
When a rollback happens, the language connection context will close all open activations and invalidate their prepared statements. Then the language will abort the Store transaction.The invalidated statements can revalidate themselves without a full recompile if they verify their dependencies' providers still exist unchanged. REVISIT when invalidation types are created.
REVISIT: this may need additional alterations when RELEASE SAVEPOINT/ROLLBACK TO SAVEPOINT show up.
Also, tell the data dictionary that the transaction is finished, if necessary (that is, if the data dictionary was put into DDL mode in this transaction.
- Parameters:
xa- true if this is an xa rollbackrequestedByUser- true if requested by user- Throws:
StandardException- thrown on failure
-
resetSavepoints
Reset all statement savepoints. Traverses the StatementContext stack from bottom to top, calling resetSavePoint() on each element.- Throws:
StandardException- thrown if something goes wrong
-
internalRollbackToSavepoint
public void internalRollbackToSavepoint(String savepointName, boolean refreshStyle, Object kindOfSavepoint) throws StandardException Let the context deal with a rollback to savepoint- Specified by:
internalRollbackToSavepointin interfaceLanguageConnectionContext- Parameters:
savepointName- Name of the savepoint that needs to be rolled backrefreshStyle- boolean indicating whether or not the controller should close open conglomerates and scans. Also used to determine if language should close open activations.kindOfSavepoint- A NULL value means it is an internal savepoint (ie not a user defined savepoint) Non NULL value means it is a user defined savepoint which can be a SQL savepoint or a JDBC savepoint A String value for kindOfSavepoint would mean it is SQL savepoint A JDBC Savepoint object value for kindOfSavepoint would mean it is JDBC savepoint- Throws:
StandardException- thrown if something goes wrong
-
releaseSavePoint
Let the context deal with a release of a savepoint- Specified by:
releaseSavePointin interfaceLanguageConnectionContext- Parameters:
savepointName- Name of the savepoint that needs to be releasedkindOfSavepoint- A NULL value means it is an internal savepoint (ie not a user defined savepoint) Non NULL value means it is a user defined savepoint which can be a SQL savepoint or a JDBC savepoint A String value for kindOfSavepoint would mean it is SQL savepoint A JDBC Savepoint object value for kindOfSavepoint would mean it is JDBC savepoint- Throws:
StandardException- thrown if something goes wrong
-
languageSetSavePoint
public void languageSetSavePoint(String savepointName, Object kindOfSavepoint) throws StandardException Sets a savepoint. Causes the Store to set a savepoint.- Specified by:
languageSetSavePointin interfaceLanguageConnectionContext- Parameters:
savepointName- name of savepointkindOfSavepoint- A NULL value means it is an internal savepoint (ie not a user defined savepoint) Non NULL value means it is a user defined savepoint which can be a SQL savepoint or a JDBC savepoint A String value for kindOfSavepoint would mean it is SQL savepoint A JDBC Savepoint object value for kindOfSavepoint would mean it is JDBC savepoint- Throws:
StandardException- thrown if something goes wrong
-
beginNestedTransaction
Start a Nested User Transaction (NUT) with the store. If a NUT is already active simply increment a counter, queryNestingDepth, to keep track of how many times we have tried to start a NUT.- Specified by:
beginNestedTransactionin interfaceLanguageConnectionContext- Parameters:
readOnly- The nested transaction would be read only if param value true- Throws:
StandardException- on error.- See Also:
-
commitNestedTransaction
Description copied from interface:LanguageConnectionContextcommit a nested transaction. We do not provide a abortNestedTransaction. If a nested xaction is aborted, then this results in the parent xaction also being aborted. This is not what we need for releasing compile time locks or autoincrement-- hence we do not provide abortNestedTransaction.- Specified by:
commitNestedTransactionin interfaceLanguageConnectionContext- Throws:
StandardException- thrown on erro- See Also:
-
getTransactionCompile
Get the transaction controller to use at compile time with this language connection context. If a NUT is active then return NUT else return parent transaction.- Specified by:
getTransactionCompilein interfaceLanguageConnectionContext
-
getTransactionExecute
Description copied from interface:LanguageConnectionContextGet the transaction controller to use with this language connection context during execute time.- Specified by:
getTransactionExecutein interfaceLanguageConnectionContext
-
getDataValueFactory
Get the data value factory to use with this language connection context.- Specified by:
getDataValueFactoryin interfaceLanguageConnectionContext
-
getLanguageFactory
Get the language factory to use with this language connection context.- Specified by:
getLanguageFactoryin interfaceLanguageConnectionContext
-
getOptimizerFactory
Description copied from interface:LanguageConnectionContextget the optimizer factory to use with this language connection context.- Specified by:
getOptimizerFactoryin interfaceLanguageConnectionContext
-
getLanguageConnectionFactory
Get the language connection factory to use with this language connection context.- Specified by:
getLanguageConnectionFactoryin interfaceLanguageConnectionContext
-
checkIfAnyActivationHasHoldCursor
check if there are any activations that reference this temporary table- Parameters:
tableName- look for any activations referencing this table name- Returns:
- boolean false if found no activations
- Throws:
StandardException
-
verifyAllHeldResultSetsAreClosed
Verify that there are no activations with open held result sets.- Specified by:
verifyAllHeldResultSetsAreClosedin interfaceLanguageConnectionContext- Returns:
- boolean Found no open (held) resultsets.
- Throws:
StandardException- thrown on failure
-
verifyNoOpenResultSets
public boolean verifyNoOpenResultSets(PreparedStatement pStmt, Provider provider, int action) throws StandardException Verify that there are no activations with open result sets on the specified prepared statement.- Specified by:
verifyNoOpenResultSetsin interfaceLanguageConnectionContext- Parameters:
pStmt- The prepared Statementprovider- The object precipitating a possible invalidationaction- The action causing the possible invalidation- Returns:
- Nothing.
- Throws:
StandardException- thrown on failure
-
getSessionUserId
Get the session user- Specified by:
getSessionUserIdin interfaceLanguageConnectionContext- Returns:
- String the authorization id of the session user.
-
getDefaultSchema
Description copied from interface:LanguageConnectionContextGet the default schema (used at compile-time when no activation is yet available, cf. the activation argument overload version.- Specified by:
getDefaultSchemain interfaceLanguageConnectionContext- Returns:
- SchemaDescriptor the default schema
- See Also:
-
getDefaultSchema
Description copied from interface:LanguageConnectionContextGet the default schema (used at execution time). At execution time, the current statement context is not always a reliable place to find the correct SQL session context, viz. when a dynamic result set referencing CURRENT SCHEMA is accessed after a called procedure has returned only the activation of the call is live and still holds the correct session context.- Specified by:
getDefaultSchemain interfaceLanguageConnectionContext- Parameters:
a- current activation- Returns:
- SchemaDescriptor the default schema
- See Also:
-
getCurrentSchemaName
Description copied from interface:LanguageConnectionContextGet the current schema name (at compile-time, see explanations for getDefaultSchema overloads).- Specified by:
getCurrentSchemaNamein interfaceLanguageConnectionContext- Returns:
- SchemaDescriptor the current schema
- See Also:
-
getCurrentSchemaName
Description copied from interface:LanguageConnectionContextGet the current schema name (at execution time, see explanations for getDefaultSchema overloads); This version is used by CURRENT SCHEMA.- Specified by:
getCurrentSchemaNamein interfaceLanguageConnectionContext- Returns:
- SchemaDescriptor the current schema
- See Also:
-
isInitialDefaultSchema
Description copied from interface:LanguageConnectionContextReturn true if this schema name is the initial default schema for the current session.- Specified by:
isInitialDefaultSchemain interfaceLanguageConnectionContext- Parameters:
schemaName-- Returns:
- true
- See Also:
-
setDefaultSchema
Description copied from interface:LanguageConnectionContextSet the default schema (at compile-time, see explanations for getDefaultSchema overloads).- Specified by:
setDefaultSchemain interfaceLanguageConnectionContext- Parameters:
sd- the new default schema. If null, then the default schema descriptor is used.- Throws:
StandardException- thrown on failure- See Also:
-
setDefaultSchema
Description copied from interface:LanguageConnectionContextSet the default schema (at execution time, see explanations for getDefaultSchema overloads); This version is used by SET SCHEMA.- Specified by:
setDefaultSchemain interfaceLanguageConnectionContext- Parameters:
a- current activationsd- the new default schema. If null, then the default schema descriptor is used.- Throws:
StandardException- thrown on failure- See Also:
-
resetSchemaUsages
Description copied from interface:LanguageConnectionContextReset any occurence of schemaName as current default schema in the SQLSessionContext stack to the initial default, because schemaName is no longer a valid schema.- Specified by:
resetSchemaUsagesin interfaceLanguageConnectionContext- Parameters:
activation- current activationschemaName- the schema name occurences of which is to be reset- Throws:
StandardException- See Also:
-
getIdentityValue
Get the identity column value most recently generated.- Specified by:
getIdentityValuein interfaceLanguageConnectionContext- Returns:
- the generated identity column value
-
setIdentityValue
public void setIdentityValue(long val) Set the field of most recently generated identity column value.- Specified by:
setIdentityValuein interfaceLanguageConnectionContext- Parameters:
val- the generated identity column value
-
pushCompilerContext
Push a CompilerContext on the context stack with the current default schema as the default schema which we compile against.- Specified by:
pushCompilerContextin interfaceLanguageConnectionContext- Returns:
- the compiler context
-
pushCompilerContext
Push a CompilerContext on the context stack with the passed in schema sd as the default schema we compile against.- Specified by:
pushCompilerContextin interfaceLanguageConnectionContext- Parameters:
sd- the default schema- Returns:
- the compiler context For the parameter sd, there are 3 possible values(of interest) that can get passed into this method: a) A null SchemaDescriptor which indicates to the system to use the CURRENT SCHEMA as the compilation schema. b) A SchemaDescriptor with its UUID == null, this indicates that either the schema has not been physically created yet or that the LCC's getDefaultSchema() is not yet up-to-date with its actual UUID. The system will use the CURRENT SCHEMA as the compilation schema. c) A SchemaDescriptor with its UUID != null, this means that the schema has been physically created. The system will use this schema as the compilation schema (e.g.: for trigger or view recompilation cases, etc.). The compiler context's compilation schema will be set accordingly based on the given input above.
-
popCompilerContext
Pop a CompilerContext off the context stack.- Specified by:
popCompilerContextin interfaceLanguageConnectionContext- Parameters:
cc- The compiler context.
-
pushStatementContext
public StatementContext pushStatementContext(boolean isAtomic, boolean isForReadOnly, String stmtText, ParameterValueSet pvs, boolean rollbackParentContext, long timeoutMillis) Push a StatementContext on the context stack. Inherit SQL session state a priori (statementContext will get its own SQL session state if this statement executes a call, cf. pushNestedSessionContext.- Specified by:
pushStatementContextin interfaceLanguageConnectionContext- Parameters:
isAtomic- whether this statement is atomic or notisForReadOnly- whether this statement is for a read only resultsetstmtText- 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.pvs- parameter value set, if it has onerollbackParentContext- True if 1) the statement context is NOT a top-level context, AND 2) in the event of a statement-level exception, the parent context needs to be rolled back, too.timeoutMillis- timeout value for this statement, in milliseconds. The value 0 means that no timeout is set.- Returns:
- StatementContext The statement context.
-
popStatementContext
Pop a StatementContext of the context stack.- Specified by:
popStatementContextin interfaceLanguageConnectionContext- Parameters:
statementContext- The statement context.error- The error, if any (Only relevant for DEBUG)
-
pushExecutionStmtValidator
Push a new execution statement validator. An execution statement validator is an object that validates the current statement to ensure that it is permitted given the current execution context. An example of a validator a trigger ExecutionStmtValidator that doesn't allow ddl on the trigger target table.Multiple ExecutionStmtValidators may be active at any given time. This mirrors the way there can be multiple connection nestings at a single time. The validation is performed by calling each validator's validateStatement() method. This yields the union of all validations.
- Specified by:
pushExecutionStmtValidatorin interfaceLanguageConnectionContext- Parameters:
validator- the validator to add
-
popExecutionStmtValidator
Remove the validator. Does an object identity (validator == validator) comparison. Asserts that the validator is found.- Specified by:
popExecutionStmtValidatorin interfaceLanguageConnectionContext- Parameters:
validator- the validator to remove- Throws:
StandardException- on error
-
pushTriggerExecutionContext
Push a new trigger execution context.Multiple TriggerExecutionContexts may be active at any given time.
- Specified by:
pushTriggerExecutionContextin interfaceLanguageConnectionContext- Parameters:
tec- the trigger execution context- Throws:
StandardException- on trigger recursion error
-
popTriggerExecutionContext
Remove the tec. Does an object identity (tec == tec) comparison. Asserts that the tec is found.- Specified by:
popTriggerExecutionContextin interfaceLanguageConnectionContext- Parameters:
tec- the tec to remove- Throws:
StandardException- on error
-
getTriggerExecutionContext
Get the topmost tec.- Specified by:
getTriggerExecutionContextin interfaceLanguageConnectionContext- Returns:
- the tec
-
validateStmtExecution
Validate a statement. Does so by stepping through all the validators and executing them. If a validator throws and exception, then the checking is stopped and the exception is passed up.- Specified by:
validateStmtExecutionin interfaceLanguageConnectionContext- Parameters:
constantAction- the constantAction that is about to be executed (and should be validated- Throws:
StandardException- on validation failure
-
pushTriggerTable
Set the trigger table descriptor. Used to compile statements that may special trigger pseudo tables.- Specified by:
pushTriggerTablein interfaceLanguageConnectionContext- Parameters:
td- the table that the trigger is defined upon
-
popTriggerTable
Remove the trigger table descriptor.- Specified by:
popTriggerTablein interfaceLanguageConnectionContext- Parameters:
td- the table to remove from the stack.
-
getTriggerTable
Get the topmost trigger table descriptor- Specified by:
getTriggerTablein interfaceLanguageConnectionContext- Returns:
- the table descriptor, or null if we aren't in the middle of compiling a create trigger.
-
getDatabase
Description copied from interface:LanguageConnectionContextReturns the Database of this connection.- Specified by:
getDatabasein interfaceLanguageConnectionContext- See Also:
-
incrementBindCount
public int incrementBindCount()Description copied from interface:LanguageConnectionContextIncrement the DataDictionary bind count. This is for keeping track of nested binding, which can happen if SQL statements are bound from within static initializers.- Specified by:
incrementBindCountin interfaceLanguageConnectionContext- Returns:
- The new bind count
- See Also:
-
decrementBindCount
public int decrementBindCount()Description copied from interface:LanguageConnectionContextDecrement the DataDictionary bind count.- Specified by:
decrementBindCountin interfaceLanguageConnectionContext- Returns:
- The new bind count
- See Also:
-
getBindCount
public int getBindCount()Description copied from interface:LanguageConnectionContextGet the DataDictionary bind count.- Specified by:
getBindCountin interfaceLanguageConnectionContext- Returns:
- The current bind count.
- See Also:
-
setDataDictionaryWriteMode
public final void setDataDictionaryWriteMode()Description copied from interface:LanguageConnectionContextRemember that the DataDictionary is in write mode, so we can take it out of write mode at the end of the transaction.- Specified by:
setDataDictionaryWriteModein interfaceLanguageConnectionContext- See Also:
-
dataDictionaryInWriteMode
public final boolean dataDictionaryInWriteMode()Description copied from interface:LanguageConnectionContextReturn true if the data dictionary is in write mode (that is, this context was informed that is is in write mode by the method call setDataDictionaryWriteMode().- Specified by:
dataDictionaryInWriteModein interfaceLanguageConnectionContext- See Also:
-
setRunTimeStatisticsMode
public final void setRunTimeStatisticsMode(boolean onOrOff) Description copied from interface:LanguageConnectionContextTurn RUNTIMESTATISTICS on or off.- Specified by:
setRunTimeStatisticsModein interfaceLanguageConnectionContext- See Also:
-
getRunTimeStatisticsMode
public boolean getRunTimeStatisticsMode()Description copied from interface:LanguageConnectionContextGet the RUNTIMESTATISTICS mode.- Specified by:
getRunTimeStatisticsModein interfaceLanguageConnectionContext- See Also:
-
setStatisticsTiming
public void setStatisticsTiming(boolean onOrOff) Description copied from interface:LanguageConnectionContextTurn STATISTICS TIMING on or off.- Specified by:
setStatisticsTimingin interfaceLanguageConnectionContext- See Also:
-
getStatisticsTiming
public boolean getStatisticsTiming()Description copied from interface:LanguageConnectionContextGet the STATISTICS TIMING mode.- Specified by:
getStatisticsTimingin interfaceLanguageConnectionContext- See Also:
-
setRunTimeStatisticsObject
Description copied from interface:LanguageConnectionContextSet the RUNTIMESTATISTICS object.- Specified by:
setRunTimeStatisticsObjectin interfaceLanguageConnectionContext- See Also:
-
getRunTimeStatisticsObject
Description copied from interface:LanguageConnectionContextGet the RUNTIMESTATISTICS object.- Specified by:
getRunTimeStatisticsObjectin interfaceLanguageConnectionContext- See Also:
-
getStatementDepth
public int getStatementDepth()Reports how many statement levels deep we are.- Specified by:
getStatementDepthin interfaceLanguageConnectionContext- Returns:
- a statement level >= OUTERMOST_STATEMENT
-
isIsolationLevelSetUsingSQLorJDBC
public boolean isIsolationLevelSetUsingSQLorJDBC()Description copied from interface:LanguageConnectionContextReturns true if isolation level has been set using JDBC/SQL.- Specified by:
isIsolationLevelSetUsingSQLorJDBCin interfaceLanguageConnectionContext- See Also:
-
resetIsolationLevelFlagUsedForSQLandJDBC
public void resetIsolationLevelFlagUsedForSQLandJDBC()Description copied from interface:LanguageConnectionContextReset the isolation level flag used to keep correct isolation level state in BrokeredConnection. This resetting will happen at the start and end of a global transaction, after the BrokeredConection's isolation level state is brought upto date with the EmbedConnection's isolation state. The flag gets set to true when isolation level is set using JDBC/SQL.- Specified by:
resetIsolationLevelFlagUsedForSQLandJDBCin interfaceLanguageConnectionContext- See Also:
-
setIsolationLevel
Description copied from interface:LanguageConnectionContextSet current isolation level.- Specified by:
setIsolationLevelin interfaceLanguageConnectionContext- Parameters:
isolationLevel- The new isolationLevel.- Throws:
StandardException- See Also:
-
getCurrentIsolationLevel
public int getCurrentIsolationLevel()Description copied from interface:LanguageConnectionContextGet the current isolation level.- Specified by:
getCurrentIsolationLevelin interfaceLanguageConnectionContext- Returns:
- The current isolation level.
- See Also:
-
getCurrentIsolationLevelStr
Description copied from interface:LanguageConnectionContextGet the current isolation level in DB2 format.- Specified by:
getCurrentIsolationLevelStrin interfaceLanguageConnectionContext- Returns:
- The current isolation level as a 2 character string.
- See Also:
-
setPrepareIsolationLevel
public void setPrepareIsolationLevel(int level) - Specified by:
setPrepareIsolationLevelin interfaceLanguageConnectionContext- See Also:
-
getPrepareIsolationLevel
public int getPrepareIsolationLevel()Description copied from interface:LanguageConnectionContextGet the prepare isolation level. If the isolation level has been explicitly set with a SQL statement or embedded call to setTransactionIsolation, this will return TransactionControl.UNSPECIFIED_ISOLATION_LEVEL SET ISOLATION always takes priority.- Specified by:
getPrepareIsolationLevelin interfaceLanguageConnectionContext- See Also:
-
getStatementContext
Description copied from interface:LanguageConnectionContextGet the current StatementContext.- Specified by:
getStatementContextin interfaceLanguageConnectionContext- See Also:
-
setOptimizerTracer
Description copied from interface:LanguageConnectionContextInstall an optimizer tracer (to enable tracing) or uninstall the current optimizer tracer (to disable tracing).- Specified by:
setOptimizerTracerin interfaceLanguageConnectionContext- Parameters:
tracer- Null if tracing is being turned off, otherwise an optimizer tracer- See Also:
-
getOptimizerTracer
Description copied from interface:LanguageConnectionContextGet the optimizer tracer (could be null if we aren't tracing the optimizer).- Specified by:
getOptimizerTracerin interfaceLanguageConnectionContext- See Also:
-
optimizerTracingIsOn
public boolean optimizerTracingIsOn()Description copied from interface:LanguageConnectionContextGet whether or not optimizer trace is on.- Specified by:
optimizerTracingIsOnin interfaceLanguageConnectionContext- Returns:
- Whether or not optimizer trace is on.
- See Also:
-
isTransactionPristine
public boolean isTransactionPristine()Reports whether there is any outstanding work in the transaction.- Specified by:
isTransactionPristinein interfaceLanguageConnectionContext- Returns:
- true if there is outstanding work in the transaction false otherwise
-
cleanupOnError
If worse than a transaction error, everything goes; we rely on other contexts to kill the context manager for this session.If a transaction error, act like we saw a rollback.
If more severe or a java error, the outer cleanup will shutdown the connection, so we don't have to clean up.
REMIND: connection should throw out all contexts and start over when the connection is closed... perhaps by throwing out the context manager?
REVISIT: If statement error, should we do anything?
Since the access manager's own context takes care of its own resources on errors, there is nothing that this context has to do with the transaction controller.
- Specified by:
cleanupOnErrorin interfaceContext- Throws:
StandardException- thrown on error. REVISIT: don't want cleanupOnError's to throw exceptions.
-
isLastHandler
public boolean isLastHandler(int severity) Description copied from interface:ContextReturn 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.- Specified by:
isLastHandlerin interfaceContext- Overrides:
isLastHandlerin classContextImpl- See Also:
-
endTransactionActivationHandling
If we are called as part of rollback code path, then we will reset all the activations that have resultset returning rows associated with them. DERBY-3304 Resultsets that do not return rows should be left alone when the rollback is through the JDBC Connection object. If the rollback is caused by an exception, then at that time, all kinds of resultsets should be closed. If we are called as part of commit code path, then we will do one of the following if the activation has resultset assoicated with it. Also, we will clear the conglomerate used while scanning for update/delete 1)Close result sets that return rows and are not held across commit. 2)Clear the current row of the resultsets that return rows and are held across commit. 3)Leave the result sets untouched if they do not return rows Additionally, clean up (close()) activations that have been marked as unused during statement finalization.- Throws:
StandardException- thrown on failure
-
finishDDTransaction
Finish the data dictionary transaction, if any.- Throws:
StandardException- Thrown on error
-
incrementStatementDepth
private void incrementStatementDepth()Increments the statement depth. -
decrementStatementDepth
private void decrementStatementDepth()Decrements the statement depth -
resetStatementDepth
protected void resetStatementDepth()Resets the statementDepth. -
getDataDictionary
Description copied from interface:LanguageConnectionContextGet the data dictionary- Specified by:
getDataDictionaryin interfaceLanguageConnectionContext- Returns:
- the data dictionary
-
setReadOnly
Description copied from interface:LanguageConnectionContextSet the readOnly status for the current connection. This can only be called when the current transaction has not done any work.- Specified by:
setReadOnlyin interfaceLanguageConnectionContext- Parameters:
on- true sets the connection to be readOnly and false sets it to readWrite.- Throws:
StandardException- The operation is disallowed.- See Also:
-
isReadOnly
public boolean isReadOnly()Description copied from interface:LanguageConnectionContextGet the readOnly status for the current connection.- Specified by:
isReadOnlyin interfaceLanguageConnectionContext- See Also:
-
getAuthorizer
Description copied from interface:LanguageConnectionContextGet an Authorizer for this connection.- Specified by:
getAuthorizerin interfaceLanguageConnectionContext- See Also:
-
lastAutoincrementValue
lastAutoincrementValue searches for the last autoincrement value inserted into a column specified by the user. The search for the "last" value supports nesting levels caused by triggers (Only triggers cause nesting, not server side JDBC). If lastAutoincrementValue is called from within a trigger, the search space for ai-values are those values that are inserted by this trigger as well as previous triggers; i.e if a SQL statement fires trigger T1, which in turn does something that fires trigger t2, and if lastAutoincrementValue is called from within t2, then autoincrement values genereated by t1 are visible to it. By the same logic, if it is called from within t1, then it does not see values inserted by t2.- Specified by:
lastAutoincrementValuein interfaceLanguageConnectionContext- Parameters:
schemaName-tableName-columnName-- See Also:
-
setAutoincrementUpdate
public void setAutoincrementUpdate(boolean flag) Description copied from interface:LanguageConnectionContextSets autoincrementUpdate-- this variable allows updates to autoincrement columns if it is set to true. The default is ofcourse false; i.e ai columns cannot be directly modified by the user. This is set to true by AlterTableConstantAction, when a new ai column is being added to an existing table.- Specified by:
setAutoincrementUpdatein interfaceLanguageConnectionContext- Parameters:
flag- the value for autoincrementUpdate (TRUE or FALSE)- See Also:
-
getAutoincrementUpdate
public boolean getAutoincrementUpdate()Description copied from interface:LanguageConnectionContextReturns the current value of autoincrementUpdate.- Specified by:
getAutoincrementUpdatein interfaceLanguageConnectionContext- Returns:
- true if updates to autoincrement columns is permitted.
- See Also:
-
autoincrementCreateCounter
public void autoincrementCreateCounter(String s, String t, String c, Long initialValue, long increment, int position) Description copied from interface:LanguageConnectionContextCreate an autoincrement counter to be used on behalf of a SQL-J statement. The counter is identified by (schemaName, tableName, columnName). The counter must be freed up by calling autoincrementFlushCache at the end of the statement. It is expected that a ai-counter with the same signaure doesn't exist when the method is called.- Specified by:
autoincrementCreateCounterin interfaceLanguageConnectionContext- Parameters:
s- SchemaNamet- TableNamec- ColumnNameinitialValue- initial value of the counter.increment- increment for the counter.position- column position (1-based).- See Also:
-
nextAutoincrementValue
public long nextAutoincrementValue(String schemaName, String tableName, String columnName) throws StandardException returns the next value to be inserted into an autoincrement col. This is used internally by the system to generate autoincrement values which are going to be inserted into a autoincrement column. This is used when as autoincrement column is added to a table by an alter table statemenet and during bulk insert.- Specified by:
nextAutoincrementValuein interfaceLanguageConnectionContext- Parameters:
schemaName-tableName-columnName- identify the column uniquely in the system.- Throws:
StandardException- on error.
-
autoincrementFlushCache
Flush the cache of autoincrement values being kept by the lcc. This will result in the autoincrement values being written to the SYSCOLUMNS table as well as the mapping used by lastAutoincrementValue- Specified by:
autoincrementFlushCachein interfaceLanguageConnectionContext- Parameters:
tableUUID- the table which is being flushed; we need this value to identify the table for which the autoincrement counter is being maintained.- Throws:
StandardException- thrown on error.- See Also:
-
copyHashtableToAIHT
Copies an existing autoincrement mapping into autoincrementHT, the cache of autoincrement values kept in the languageconnectioncontext.- Specified by:
copyHashtableToAIHTin interfaceLanguageConnectionContext
-
getInstanceNumber
public int getInstanceNumber()Description copied from interface:LanguageConnectionContextGet the instance number of this LCC.- Specified by:
getInstanceNumberin interfaceLanguageConnectionContext- Returns:
- instance number of this LCC.
- See Also:
-
getDrdaID
Description copied from interface:LanguageConnectionContextGet the DRDA ID of this LCC.- Specified by:
getDrdaIDin interfaceLanguageConnectionContext- Returns:
- DRDA ID this LCC.
- See Also:
-
setDrdaID
Description copied from interface:LanguageConnectionContextSet the DRDA ID of this LCC.- Specified by:
setDrdaIDin interfaceLanguageConnectionContext- Parameters:
drdaID- DRDA ID.- See Also:
-
getDbname
Description copied from interface:LanguageConnectionContextGet the database name of this LCC.- Specified by:
getDbnamein interfaceLanguageConnectionContext- Returns:
- database name of this LCC.
- See Also:
-
getLastActivation
Description copied from interface:LanguageConnectionContextReturn the last activation added This is used to find the drop activation in dropViewCascade so we can add warning messages to the activation- Specified by:
getLastActivationin interfaceLanguageConnectionContext- See Also:
-
appendErrorInfo
- Overrides:
appendErrorInfoin classContextImpl
-
setCurrentRole
Description copied from interface:LanguageConnectionContextSet the current role- Specified by:
setCurrentRolein interfaceLanguageConnectionContext- Parameters:
a- activation of set role statementrole- the id of the role to be set to current- See Also:
-
getCurrentRoleId
Description copied from interface:LanguageConnectionContextGet the current role authorization identifier of the dynamic call context associated with this activation.- Specified by:
getCurrentRoleIdin interfaceLanguageConnectionContext- Parameters:
a- activation of statement needing current role- Returns:
- String the role id
- See Also:
-
getCurrentUserId
Description copied from interface:LanguageConnectionContextGet the Authorization Id of the current user- Specified by:
getCurrentUserIdin interfaceLanguageConnectionContext- Parameters:
a- activation- Returns:
- String the authorization id
- See Also:
-
getCurrentRoleIdDelimited
Description copied from interface:LanguageConnectionContextGet the current role authorization identifier in external delimited form (not case normal form) of the dynamic call context associated with this activation.- Specified by:
getCurrentRoleIdDelimitedin interfaceLanguageConnectionContext- Parameters:
a- activation of statement needing current role- Returns:
- String the role id in delimited form (i.e. not internal case normal form)
- Throws:
StandardException- standard exception policy- See Also:
-
roleIsSettable
Description copied from interface:LanguageConnectionContextChecks whether the given role can be legally set for the current user. This method will read (potentially) the dictionary, so it needs a transaction context.- Specified by:
roleIsSettablein interfaceLanguageConnectionContext- Parameters:
a- activationrole- string containing role name- Returns:
- true if the role can be set
- Throws:
StandardException- standard exception policy- See Also:
-
getCurrentSQLSessionContext
Return the current SQL session context of the activation- Specified by:
getCurrentSQLSessionContextin interfaceLanguageConnectionContext- Parameters:
activation- the activation- Returns:
- The SQL session object
-
getCurrentSQLSessionContext
Return the current SQL session context based on statement context -
pushNestedSessionContext
public void pushNestedSessionContext(Activation a, boolean definersRights, String definer) throws StandardException Create a new SQL session context for the current activation on the basis of the existing SQL session context. This happens when a stored procedure or function that can contain SQL is invoked, cf. SQL 2003 section 4.27.3, since this gives rise to a nested connection.Called from generated code, see
StaticMethodCallNode.generatePushNestedSessionContext(ActivationClassBuilder, MethodBuilder, boolean, String).The new SQL session context is also set in the current statement context (of the invocation).
- Specified by:
pushNestedSessionContextin interfaceLanguageConnectionContext- Parameters:
a- activation of the statement which performs the call.definersRights- if the method should run with definer's rightsdefiner- authorization id of the definer- Throws:
StandardException- standard error policy- See Also:
-
setupSessionContextMinion
private void setupSessionContextMinion(Activation a, boolean push, boolean definersRights, String definer) throws StandardException - Throws:
StandardException
-
popNestedSessionContext
Description copied from interface:LanguageConnectionContextIf returning from a routine that can execute SQL, perform any actions needed when popping the SQL session context.- Specified by:
popNestedSessionContextin interfaceLanguageConnectionContext- Parameters:
a- activation- Throws:
StandardException- standard error policy
-
compareConstraintModes
private void compareConstraintModes(SQLSessionContext nested, SQLSessionContext caller) throws StandardException - Throws:
StandardException
-
isEffectivelyDeferred
public boolean isEffectivelyDeferred(SQLSessionContext sc, UUID constraintId) throws StandardException Description copied from interface:LanguageConnectionContextDetermines if a check or foreign key constraint has deferred mode.- Specified by:
isEffectivelyDeferredin interfaceLanguageConnectionContext- Parameters:
sc- The SQL session context for which we are asking the statusconstraintId- The constraint id we are inquiring about.- Returns:
trueif the constraint is deferred- Throws:
StandardException- Standard error policy
-
setupSubStatementSessionContext
Description copied from interface:LanguageConnectionContextUsed when a statement as part of its operation executes an other statement. In contrast to pushNestedSessionContext, the activation (for the substatement) just inherits the current session context from the parent statements activation, it does not push a new copy on the stack of session contexts. Currently, this is used in the following situations:- With
ALTER TABLEadding a column which has a default values, the default value for all the existing rows is added using anUPDATEsubstatement. - With
ALTER TABLEadding a a check constraint, we will use a substatementSELECTto check if all rows satisfy the constraint. ResultSet.insertRow,updateRowanddeleteRow.- During trigger body execution.
- Specified by:
setupSubStatementSessionContextin interfaceLanguageConnectionContext- Throws:
StandardException- See Also:
- With
-
getTopLevelSQLSessionContext
Description copied from interface:LanguageConnectionContextGet the value of top level session context of the top level connection.- Specified by:
getTopLevelSQLSessionContextin interfaceLanguageConnectionContext- Returns:
- the requested session context
- See Also:
-
createSQLSessionContext
Description copied from interface:LanguageConnectionContextCreate a fresh SQLSessionContext for this connection.- Specified by:
createSQLSessionContextin interfaceLanguageConnectionContext- Returns:
- new SQLSessionContext
- See Also:
-
getPrintedObjectsMap
Description copied from interface:LanguageConnectionContextReturn a map of AST nodes that have already been printed during a compiler phase, so as to be able to avoid printing a node more than once.- Specified by:
getPrintedObjectsMapin interfaceLanguageConnectionContext- Returns:
- the map
- See Also:
-
getXplainOnlyMode
public boolean getXplainOnlyMode()Description copied from interface:LanguageConnectionContextgets the current set XplainOnlyMode- Specified by:
getXplainOnlyModein interfaceLanguageConnectionContext- See Also:
-
setXplainOnlyMode
public void setXplainOnlyMode(boolean onOrOff) Description copied from interface:LanguageConnectionContextsets the XplainOnlyMode. If a connection is in XplainOnlyMode, then the statements are not actually being executed, but are just being compiled and the runtime statistics collected into the XPLAIN tables. This can be set on and off by calling SYSCS_SET_XPLAIN_MODE.- Specified by:
setXplainOnlyModein interfaceLanguageConnectionContext- Parameters:
onOrOff- true if statements are to be XPLAINed only.- See Also:
-
getXplainSchema
Description copied from interface:LanguageConnectionContextgets the current set XplainSchema- Specified by:
getXplainSchemain interfaceLanguageConnectionContext- Returns:
- the Schema of Xplain, may be null.
- See Also:
-
setXplainSchema
Description copied from interface:LanguageConnectionContextsets the XplainSchema- Specified by:
setXplainSchemain interfaceLanguageConnectionContext- Parameters:
s- the schema to use for storing XPLAIN'd statements null means don't store the xplain information non-null means persistent style, use the indicated schema- See Also:
-
setXplainStatement
- Specified by:
setXplainStatementin interfaceLanguageConnectionContext
-
getXplainStatement
- Specified by:
getXplainStatementin interfaceLanguageConnectionContext
-
setASTVisitor
Description copied from interface:LanguageConnectionContextSet a Visitor which walks the AST at various stages. This is useful for poking user-written inspectors into the parse, bind, and optimize phases.- Specified by:
setASTVisitorin interfaceLanguageConnectionContext- Parameters:
visitor- The Visitor which should walk the tree. Could be null.
-
getASTVisitor
Description copied from interface:LanguageConnectionContextGet the Visitor which should walk the AST.- Specified by:
getASTVisitorin interfaceLanguageConnectionContext- Returns:
- The Visitor for that phase. Could be null.
-
setInterruptedException
Description copied from interface:LanguageConnectionContextSet the exception created and associated with the detected interruped status flag.- Specified by:
setInterruptedExceptionin interfaceLanguageConnectionContext- Parameters:
e- the created exception
-
getInterruptedException
Description copied from interface:LanguageConnectionContextGet exception created when we detected interruped status flag.- Specified by:
getInterruptedExceptionin interfaceLanguageConnectionContext- Returns:
- saved exception
-
getReferencedColumnMap
Description copied from interface:LanguageConnectionContextGet the referenced column map for a table- Specified by:
getReferencedColumnMapin interfaceLanguageConnectionContext- Returns:
- the map
-
setReferencedColumnMap
Description copied from interface:LanguageConnectionContextSet the referenced column map for a table- Specified by:
setReferencedColumnMapin interfaceLanguageConnectionContext- Parameters:
td- the table descriptormap- the map
-
setConstraintDeferred
public void setConstraintDeferred(Activation a, ConstraintDescriptor cd, boolean deferred) throws StandardException Set the constraint mode to deferred for the specified constraint.- Specified by:
setConstraintDeferredin interfaceLanguageConnectionContext- Parameters:
a- activationcd- the constraint descriptordeferred- the constraint mode- Throws:
StandardException- standard error policy
-
checkIntegrity
Description copied from interface:LanguageConnectionContextCheck that deferred constraints are valid, if not roll back the transaction.- Specified by:
checkIntegrityin interfaceLanguageConnectionContext- Throws:
StandardException
-
clearDeferreds
private void clearDeferreds()Clear deferred information for this transaction. -
setDeferredAll
Description copied from interface:LanguageConnectionContextSet the constraint mode of all deferrable constraints to the value ofdeferred. If the value isfalse, this method might throw with a constraint violation error, i.e. if some constraint has deferred mode before this call and had seen violations.- Specified by:
setDeferredAllin interfaceLanguageConnectionContext- Parameters:
a- The activationdeferred- The value which holds the constraint mode- Throws:
StandardException- Standard error policy
-
getDeferredHashTables
Description copied from interface:LanguageConnectionContextGet the set of disk backed hash tables containing any index rows saved for deferred unique/PK constraints in this transaction, keyed by the conglomerate id, or rows saved containing row locations violating rows for deferred check constraints.- Specified by:
getDeferredHashTablesin interfaceLanguageConnectionContext- Returns:
- the set
-
validateDeferredConstraints
Validate all deferred constraints.- Throws:
StandardException
-
validateDeferredConstraint
Validate a deferred constraint.- Parameters:
cd- the descriptor of the constraint to validate- Throws:
StandardException
-