Top Description Fields Constructors Methods
org.apache.derby.impl.sql.conn

public Class GenericLanguageConnectionContext

extends ContextImpl
implements LanguageConnectionContext
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.services.context.Context
Imports
java.util.ArrayList, .HashMap, .IdentityHashMap, .Iterator, .List, .Map, .Set, .WeakHashMap, org.apache.derby.catalog.UUID, org.apache.derby.iapi.db.Database, .TriggerExecutionContext, org.apache.derby.shared.common.error.ExceptionSeverity, .StandardException, org.apache.derby.shared.common.reference.ContextId, .Limits, .Property, .SQLState, org.apache.derby.iapi.services.cache.CacheManager, .Cacheable, org.apache.derby.iapi.services.context.Context, .ContextImpl, .ContextManager, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.iapi.services.loader.GeneratedClass, org.apache.derby.iapi.services.monitor.Monitor, org.apache.derby.iapi.services.property.PropertyUtil, org.apache.derby.shared.common.stream.HeaderPrintWriter, org.apache.derby.iapi.sql.Activation, .LanguageFactory, .ParameterValueSet, .PreparedStatement, .ResultSet, org.apache.derby.iapi.sql.compile.ASTVisitor, .CompilerContext, .OptTrace, .OptimizerFactory, .TypeCompilerFactory, org.apache.derby.iapi.sql.conn.Authorizer, .LanguageConnectionContext, .LanguageConnectionFactory, .SQLSessionContext, .StatementContext, org.apache.derby.iapi.sql.depend.DependencyManager, .Provider, org.apache.derby.iapi.sql.dictionary.CheckConstraintDescriptor, .ConglomerateDescriptor, .ConglomerateDescriptorList, .ConstraintDescriptor, .DataDictionary, .RoleGrantDescriptor, .SchemaDescriptor, .TableDescriptor, org.apache.derby.iapi.sql.execute.ConstantAction, .CursorActivation, .ExecPreparedStatement, .ExecutionStmtValidator, .RunTimeStatistics, org.apache.derby.iapi.store.access.TransactionController, .XATransactionController, org.apache.derby.iapi.transaction.TransactionControl, org.apache.derby.iapi.types.DataValueFactory, org.apache.derby.iapi.util.IdUtil, .InterruptStatus, org.apache.derby.impl.sql.GenericPreparedStatement, .GenericStatement, org.apache.derby.impl.sql.compile.CompilerContextImpl, org.apache.derby.impl.sql.execute.AutoincrementCounter, .DeferredConstraintsMemory.ValidationInfo, org.apache.derby.shared.common.sanity.SanityManager

LanguageConnectionContext keeps the pool of prepared statements, activations, and cursors in use by the current connection.

The generic impl does not provide statement caching.

Field Summary

Modifier and TypeField and Description
private final ArrayList<Activation>
private ArrayList<TempTableInfo>
private ASTVisitor
protected Authorizer
private HashMap<String, AutoincrementCounter>
private HashMap<String, Long>
autoincrementHT

To support lastAutoincrementValue: This is a hashtable which maps schemaName,tableName,columnName to a Long value.

private boolean
autoincrementUpdate

whether to allow updates or not.

protected int
private SchemaDescriptor
cachedInitialDefaultSchemaDescr

Used to hold the computed value of the initial default schema, cf logic in initDefaultSchemaDescriptor.

protected LanguageConnectionFactory
private int
protected DataValueFactory
private Database
private String
private boolean
private int
private HashMap<UUID, DeferredConstraintsMemory.ValidationInfo>
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.

private String
private boolean
private long
private final int
private StandardException
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.

protected int
private boolean
private boolean
private HeaderPrintWriter
protected LanguageFactory
private Object
private int
private boolean
private boolean
private int
maxActsSize

The maximum size of acts since the last time it was trimmed.

protected long
protected int
private static final int
protected OptimizerFactory
private OptTrace
protected int
protected int
pack-priv Map<Object, Object>
printedObjectsMap

This 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 int
queryNestingDepth

queryNestingDepth is a counter used to keep track of how many calls have been made to begin read-only nested transactions.

private TransactionController
readOnlyNestedTransaction

If non-null indicates that a read-only nested user transaction is in progress.

private WeakHashMap<TableDescriptor, FormatableBitSet>
referencedColumnMap

Connection local state for cached TableDescriptors used for keeping track of referenced columns for a table during DDL operations.

private RunTimeStatistics
private boolean
private StringBuffer
private String
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.

private final StatementContext[]
private int
private boolean
private ArrayList<ExecutionStmtValidator>
protected TypeCompilerFactory
private SQLSessionContext
topLevelSSC

The top SQL session context stack frame (SQL 2003, section 4.37.3), is kept in topLevelSSC.

private final TransactionController
tran

The transaction to use within this language connection context.

private ArrayList<TriggerExecutionContext>
private ArrayList<TableDescriptor>
private volatile boolean
protected String
private static final int
private static final int
private String
xplain_schema

the current xplain schema.

private Map<Object, Object>
xplain_statements

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 boolean
xplainOnlyMode

If 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.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addActivation(Activation a)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.addActivation.

Add the activation to those known about by this connection.

public void
addDeclaredGlobalTempTable(TableDescriptor
Corresponding to the temporary table
td
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.addDeclaredGlobalTempTable.

Add the declared global temporary table to the list of temporary tables known by this connection.

public StringBuffer
public void
autoincrementCreateCounter(String
SchemaName
s
,
String
TableName
t
,
String
ColumnName
c
,
Long
initial value of the counter.
initialValue
,
long
increment for the counter.
increment
,
int
column position (1-based).
position
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.autoincrementCreateCounter.

Create an autoincrement counter to be used on behalf of a SQL-J statement.

public void
autoincrementFlushCache(UUID
the table which is being flushed; we need this value to identify the table for which the autoincrement counter is being maintained.
tableUUID
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.autoincrementFlushCache.

Flush the cache of autoincrement values being kept by the lcc.

public void
beginNestedTransaction(boolean
The nested transaction would be read only if param value true
readOnly
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.beginNestedTransaction.

Start a Nested User Transaction (NUT) with the store.

private boolean

Returns:

boolean false if found no activations
checkIfAnyActivationHasHoldCursor
(String
look for any activations referencing this table name
tableName
)

check if there are any activations that reference this temporary table

public boolean
public void
checkIntegrity()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.checkIntegrity.

Check that deferred constraints are valid, if not roll back the transaction.

public void
cleanupOnError(Throwable
The original error
error
)

Implements org.apache.derby.iapi.services.context.Context.cleanupOnError.

If worse than a transaction error, everything goes; we rely on other contexts to kill the context manager for this session.

private TableDescriptor
cleanupTempTableOnCommitOrRollback(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 void
clearDeferreds()

Clear deferred information for this transaction.

public void
closeUnusedActivations()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.closeUnusedActivations.

Close any unused activations in this connection context.

public void
private void
public void
copyHashtableToAIHT(Map<String, Long> from)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.copyHashtableToAIHT.

Copies an existing autoincrement mapping into autoincrementHT, the cache of autoincrement values kept in the languageconnectioncontext.

public SQLSessionContext
createSQLSessionContext()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.createSQLSessionContext.

Create a fresh SQLSessionContext for this connection.

public final boolean
dataDictionaryInWriteMode()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.dataDictionaryInWriteMode.

Return 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().

public int
private void
decrementStatementDepth()

Decrements the statement depth

protected void
doCommit(boolean
true if we should commit the Store transaction
commitStore
,
boolean
true means do a synchronized commit, false means do an unsynchronized commit
sync
,
int
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.
commitflag
,
boolean
False iff the commit is for internal use and we should ignore the check to prevent commits in an atomic statement.
requestedByUser
)

This is where the work on internalCommit(), userCOmmit() and internalCommitNoSync() actually takes place.

private void
doRollback(boolean
true if this is an xa rollback
xa
,
boolean
true if requested by user
requestedByUser
)

When a rollback happens, the language connection context will close all open activations and invalidate their prepared statements.

private void
dropAllDeclaredGlobalTempTables()

Drop all the declared global temporary tables associated with this connection.

public boolean
dropDeclaredGlobalTempTable(String
look for this table name in the saved list and drop it if found
tableName
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.dropDeclaredGlobalTempTable.

Drop (mark the declared global temporary table for dropping) from the list of temporary tables known by this connection.

private void
endTransactionActivationHandling(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 TempTableInfo

Returns:

data structure defining the temporary table if found. Else, return null
findDeclaredGlobalTempTable
(String
look for this table name in the saved list
tableName
)

Find the declared global temporary table in the list of temporary tables known by this connection.

private void
finishDDTransaction()

Finish the data dictionary transaction, if any.

public int
getActivationCount()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getActivationCount.

Return the number of activations known for this connection.

public ASTVisitor
getASTVisitor()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getASTVisitor.

Get the Visitor which should walk the AST.

public Authorizer
public boolean
public int
public int
public String
public String
getCurrentRoleId(Activation
activation of statement needing current role
a
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getCurrentRoleId.

Get the current role authorization identifier of the dynamic call context associated with this activation.

public String
getCurrentRoleIdDelimited(Activation
activation of statement needing current role
a
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getCurrentRoleIdDelimited.

Get the current role authorization identifier in external delimited form (not case normal form) of the dynamic call context associated with this activation.

public String
getCurrentSchemaName()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getCurrentSchemaName.

Get the current schema name (at compile-time, see explanations for getDefaultSchema overloads).

public String
getCurrentSchemaName(Activation a)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getCurrentSchemaName.

Get the current schema name (at execution time, see explanations for getDefaultSchema overloads); This version is used by CURRENT SCHEMA.

public SQLSessionContext
getCurrentSQLSessionContext(Activation
the activation
activation
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getCurrentSQLSessionContext.

Return the current SQL session context of the activation

private SQLSessionContext
getCurrentSQLSessionContext()

Return the current SQL session context based on statement context

public String
getCurrentUserId(Activation
activation
a
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getCurrentUserId.

Get the Authorization Id of the current user

public Database
getDatabase()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getDatabase.

Returns the Database of this connection.

public DataDictionary
public DataValueFactory
getDataValueFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getDataValueFactory.

Get the data value factory to use with this language connection context.

public String
getDbname()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getDbname.

Get the database name of this LCC.

public SchemaDescriptor
getDefaultSchema()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getDefaultSchema.

Get the default schema (used at compile-time when no activation is yet available, cf. the activation argument overload version.

public SchemaDescriptor
getDefaultSchema(Activation
current activation
a
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getDefaultSchema.

Get the default schema (used at execution time).

public HashMap<UUID, DeferredConstraintsMemory.ValidationInfo>
getDeferredHashTables()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getDeferredHashTables.

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.

public String
public Long

Returns:

the generated identity column value
getIdentityValue
()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getIdentityValue.

Get the identity column value most recently generated.

private SchemaDescriptor

Returns:

the schema descriptor of the computed initial default schema
getInitialDefaultSchemaDescriptor
()

Get the computed value for the initial default schema.

public int
public StandardException
getInterruptedException()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getInterruptedException.

Get exception created when we detected interruped status flag.

public LanguageConnectionFactory
getLanguageConnectionFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getLanguageConnectionFactory.

Get the language connection factory to use with this language connection context.

public LanguageFactory
getLanguageFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getLanguageFactory.

Get the language factory to use with this language connection context.

public Activation
getLastActivation()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getLastActivation.

Return the last activation added This is used to find the drop activation in dropViewCascade so we can add warning messages to the activation

public Object
getLastQueryTree()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getLastQueryTree.

Debug method for retrieving the last query tree.

public int
public boolean
public boolean
private String

Returns:

A unique String for a statement name.
getNameString
(String
The prefix for the statement name.
prefix
,
long
The number to append for uniqueness
number
)

Build a String for a statement name.

public OptimizerFactory
getOptimizerFactory()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getOptimizerFactory.

get the optimizer factory to use with this language connection context.

public OptTrace
getOptimizerTracer()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getOptimizerTracer.

Get the optimizer tracer (could be null if we aren't tracing the optimizer).

public int
public Map<Object, Object>
getPrintedObjectsMap()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getPrintedObjectsMap.

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.

public FormatableBitSet
public boolean
public RunTimeStatistics
public String

Returns:

String the authorization id of the session user.
getSessionUserId
()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getSessionUserId.

Get the session user

public StatementContext
public int

Returns:

a statement level >= OUTERMOST_STATEMENT
getStatementDepth
()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getStatementDepth.

Reports how many statement levels deep we are.

public boolean
public TableDescriptor
getTableDescriptorForDeclaredGlobalTempTable(String
Get table descriptor for the passed table name
tableName
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getTableDescriptorForDeclaredGlobalTempTable.

Get table descriptor for the declared global temporary table from the list of temporary tables known by this connection.

public SQLSessionContext
getTopLevelSQLSessionContext()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getTopLevelSQLSessionContext.

Get the value of top level session context of the top level connection.

public final TransactionController
getTransactionCompile()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getTransactionCompile.

Get the transaction controller to use at compile time with this language connection context.

public TransactionController
getTransactionExecute()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getTransactionExecute.

Get the transaction controller to use with this language connection context during execute time.

public TriggerExecutionContext
public TableDescriptor

Returns:

the table descriptor, or null if we aren't in the middle of compiling a create trigger.
getTriggerTable
()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getTriggerTable.

Get the topmost trigger table descriptor

public String
getUniqueCursorName()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getUniqueCursorName.

Get a connection unique system generated name for a cursor.

public int
getUniqueSavepointID()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getUniqueSavepointID.

Get a connection unique system generated id for an unnamed savepoint.

public String
getUniqueSavepointName()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.getUniqueSavepointName.

Get a connection unique system generated name for an unnamed savepoint.

public boolean
public String
public Object
public int
private void
incrementStatementDepth()

Increments the statement depth.

protected SchemaDescriptor

Returns:

computed initial default schema value for this session
initDefaultSchemaDescriptor
()

Compute the initial default schema and set cachedInitialDefaultSchemaDescr accordingly.

public void
public void
internalCommit(boolean
true if we should commit the Store transaction
commitStore
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.internalCommit.

Do a commit as appropriate for an internally generated commit (e.g. as needed by sync, or autocommit).

public final void
internalCommitNoSync(int
the flags to pass to commitNoSync in the store's TransactionController
commitflag
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.internalCommitNoSync.

Commit the language transaction by doing a commitNoSync() on the store's TransactionController.

public void
internalRollback()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.internalRollback.

Do a rollback as appropriate for an internally generated rollback (e.g. as needed by sync, or autocommit).

public void
internalRollbackToSavepoint(String
Name of the savepoint that needs to be rolled back
savepointName
,
boolean
boolean indicating whether or not the controller should close open conglomerates and scans. Also used to determine if language should close open activations.
refreshStyle
,
Object
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
kindOfSavepoint
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.internalRollbackToSavepoint.

Let the context deal with a rollback to savepoint

private void
invalidateCleanupDroppedTable(TableDescriptor td)

Invalidate a dropped temp table

public boolean
isEffectivelyDeferred(SQLSessionContext
The SQL session context for which we are asking the status
sc
,
UUID
The constraint id we are inquiring about.
constraintId
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.isEffectivelyDeferred.

Determines if a check or foreign key constraint has deferred mode.

public boolean
isInitialDefaultSchema(String schemaName)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.isInitialDefaultSchema.

Return true if this schema name is the initial default schema for the current session.

public boolean
public boolean
isLastHandler(int
The severity level
severity
)

Overrides org.apache.derby.iapi.services.context.ContextImpl.isLastHandler.

Implements org.apache.derby.iapi.services.context.Context.isLastHandler.

Return whether or not this context is the "last" handler for a the specified severity level.

public boolean
isReadOnly()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.isReadOnly.

Get the readOnly status for the current connection.

public boolean

Returns:

true if there is outstanding work in the transaction false otherwise
isTransactionPristine
()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.isTransactionPristine.

Reports whether there is any outstanding work in the transaction.

public void
languageSetSavePoint(String
name of savepoint
savepointName
,
Object
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
kindOfSavepoint
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.languageSetSavePoint.

Sets a savepoint.

public Long
lastAutoincrementValue(String schemaName, String tableName, String columnName)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.lastAutoincrementValue.

lastAutoincrementValue searches for the last autoincrement value inserted into a column specified by the user.

public CursorActivation

Returns:

the activation for the given cursor, null if none was found.
lookupCursorActivation
(String cursorName)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.lookupCursorActivation.

See if a given cursor is available for use.

public PreparedStatement

Returns:

the prepared statement for the given string, null if none was found.
lookupStatement
(GenericStatement statement)

See if a given statement has already been compiled for this user, and if so use its prepared statement.

public void
markTempTableAsModifiedInUnitOfWork(String
Mark the passed temporary table name as modified
tableName
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.markTempTableAsModifiedInUnitOfWork.

Mark the passed temporary table as modified in the current unit of work.

public long
nextAutoincrementValue(String schemaName, String tableName, String
identify the column uniquely in the system.
columnName
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.nextAutoincrementValue.

returns the next value to be inserted into an autoincrement col.

public void
public boolean
public void
popCompilerContext(CompilerContext
The compiler context.
cc
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.popCompilerContext.

Pop a CompilerContext off the context stack.

public void
public void
popNestedSessionContext(Activation
activation
a
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.popNestedSessionContext.

If returning from a routine that can execute SQL, perform any actions needed when popping the SQL session context.

public void
popStatementContext(StatementContext
The statement context.
statementContext
,
Throwable
The error, if any (Only relevant for DEBUG)
error
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.popStatementContext.

Pop a StatementContext of the context stack.

public void
public void
popTriggerTable(TableDescriptor
the table to remove from the stack.
td
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.popTriggerTable.

Remove the trigger table descriptor.

public PreparedStatement
prepareInternalStatement(SchemaDescriptor
schema
compilationSchema
,
String
sql query string
sqlText
,
boolean
read only status for resultset. Set to true if the concurrency mode for the resultset is CONCUR_READ_ONLY
isForReadOnly
,
boolean
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.
forMetaData
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.prepareInternalStatement.

Return a PreparedStatement object for the query.

public PreparedStatement
prepareInternalStatement(String
sql query string
sqlText
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.prepareInternalStatement.

Return a PreparedStatement object for the query.

public final CompilerContext

Returns:

the compiler context
pushCompilerContext
()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.pushCompilerContext.

Push a CompilerContext on the context stack with the current default schema as the default schema which we compile against.

public CompilerContext

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.
pushCompilerContext
(SchemaDescriptor
the default schema
sd
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.pushCompilerContext.

Push a CompilerContext on the context stack with the passed in schema sd as the default schema we compile against.

public void
public void
pushNestedSessionContext(Activation
activation of the statement which performs the call.
a
,
boolean
if the method should run with definer's rights
definersRights
,
String
authorization id of the definer
definer
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.pushNestedSessionContext.

Create a new SQL session context for the current activation on the basis of the existing SQL session context.

public StatementContext

Returns:

StatementContext The statement context.
pushStatementContext
(boolean
whether this statement is atomic or not
isAtomic
,
boolean
whether this statement is for a read only 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
,
boolean
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.
rollbackParentContext
,
long
timeout value for this statement, in milliseconds. The value 0 means that no timeout is set.
timeoutMillis
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.pushStatementContext.

Push a StatementContext on the context stack.

public void
public void
pushTriggerTable(TableDescriptor
the table that the trigger is defined upon
td
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.pushTriggerTable.

Set the trigger table descriptor.

public void
releaseSavePoint(String
Name of the savepoint that needs to be released
savepointName
,
Object
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
kindOfSavepoint
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.releaseSavePoint.

Let the context deal with a release of a savepoint

public void
removeActivation(Activation a)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.removeActivation.

Remove the activation to those known about by this connection.

public void
removeStatement(GenericStatement
Statement to remove
statement
)

This method will remove a statement from the statement cache.

private void
replaceDeclaredGlobalTempTable(String
Temporary table name whose table descriptor is getting changed
tableName
,
TableDescriptor
New table descriptor for the temporary table
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.

public void
resetFromPool()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.resetFromPool.

Reset the connection before it is returned (indirectly) by a PooledConnection object.

public void
resetIsolationLevelFlagUsedForSQLandJDBC()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.resetIsolationLevelFlagUsedForSQLandJDBC.

Reset the isolation level flag used to keep correct isolation level state in BrokeredConnection.

private void
resetSavepoints()

Reset all statement savepoints.

public void
resetSchemaUsages(Activation
current activation
activation
,
String
the schema name occurences of which is to be reset
schemaName
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.resetSchemaUsages.

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 void
resetStatementDepth()

Resets the statementDepth.

public boolean
roleIsSettable(Activation
activation
a
,
String
string containing role name
role
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.roleIsSettable.

Checks whether the given role can be legally set for the current user.

public void
setASTVisitor(ASTVisitor
The Visitor which should walk the tree. Could be null.
visitor
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setASTVisitor.

Set a Visitor which walks the AST at various stages.

public void
setAutoincrementUpdate(boolean
the value for autoincrementUpdate (TRUE or FALSE)
flag
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setAutoincrementUpdate.

Sets autoincrementUpdate-- this variable allows updates to autoincrement columns if it is set to true.

public void
setConstraintDeferred(final Activation
activation
a
,
ConstraintDescriptor
the constraint descriptor
cd
,
final boolean
the constraint mode
deferred
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setConstraintDeferred.

Set the constraint mode to deferred for the specified constraint.

public void
setCurrentRole(Activation
activation of set role statement
a
,
String
the id of the role to be set to current
role
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setCurrentRole.

Set the current role

public final void
setDataDictionaryWriteMode()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setDataDictionaryWriteMode.

Remember that the DataDictionary is in write mode, so we can take it out of write mode at the end of the transaction.

public void
setDefaultSchema(SchemaDescriptor
the new default schema. If null, then the default schema descriptor is used.
sd
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setDefaultSchema.

Set the default schema (at compile-time, see explanations for getDefaultSchema overloads).

public void
setDefaultSchema(Activation
current activation
a
,
SchemaDescriptor
the new default schema. If null, then the default schema descriptor is used.
sd
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setDefaultSchema.

Set the default schema (at execution time, see explanations for getDefaultSchema overloads); This version is used by SET SCHEMA.

public void
setDeferredAll(final Activation
The activation
a
,
final boolean
The value which holds the constraint mode
deferred
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setDeferredAll.

Set the constraint mode of all deferrable constraints to the value of deferred.

public void
setDrdaID(String
DRDA ID.
drdaID
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setDrdaID.

Set the DRDA ID of this LCC.

public void
setIdentityValue(long
the generated identity column value
val
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setIdentityValue.

Set the field of most recently generated identity column value.

public void
setInterruptedException(StandardException
the created exception
e
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setInterruptedException.

Set the exception created and associated with the detected interruped status flag.

public void
setIsolationLevel(int
The new isolationLevel.
isolationLevel
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setIsolationLevel.

Set current isolation level.

public void
setLastQueryTree(Object queryTree)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setLastQueryTree.

Debug method for remembering the last query tree.

public void
setLogStatementText(boolean
Whether or not logStatementText property is set.
logStatementText
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setLogStatementText.

Set value of logStatementText (Whether or not to write info on currently executing statement to error log.)

public void
setOptimizerTracer(OptTrace
Null if tracing is being turned off, otherwise an optimizer tracer
tracer
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setOptimizerTracer.

Install an optimizer tracer (to enable tracing) or uninstall the current optimizer tracer (to disable tracing).

public void
public void
setReadOnly(boolean
true sets the connection to be readOnly and false sets it to readWrite.
on
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setReadOnly.

Set the readOnly status for the current connection.

public void
setReferencedColumnMap(TableDescriptor
the table descriptor
td
,
FormatableBitSet
the map
map
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setReferencedColumnMap.

Set the referenced column map for a table

public final void
public void
public void
setStatisticsTiming(boolean onOrOff)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setStatisticsTiming.

Turn STATISTICS TIMING on or off.

private void
setupSessionContextMinion(Activation a, boolean push, boolean definersRights, String definer)

public void
setupSubStatementSessionContext(Activation a)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setupSubStatementSessionContext.

Used when a statement as part of its operation executes an other statement.

public void
setXplainOnlyMode(boolean
true if statements are to be XPLAINed only.
onOrOff
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setXplainOnlyMode.

sets the XplainOnlyMode.

public void
setXplainSchema(String
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
s
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.setXplainSchema.

sets the XplainSchema

public void
private void
tempTablesAndCommit(boolean
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.
in_xa_transaction
)

Do the necessary work at commit time for temporary tables

1)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.

private void
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.

private void
tempTablesReleaseSavepointLevels()

After a release of a savepoint, we need to go through our temp tables list.

private void
public void
userCommit()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.userCommit.

Do a commmit as is appropriate for a user requested commit (e.g. a java.sql.Connection.commit() or a language 'COMMIT' statement.

public void
userRollback()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.userRollback.

Do a rollback as is appropriate for a user requested rollback (e.g. a java.sql.Connection.rollback() or a language 'ROLLBACk' statement.

public boolean
usesSqlAuthorization()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.usesSqlAuthorization.

Check if in SQL standard mode, with support for Grant and Revoke

private void
validateDeferredConstraint(ConstraintDescriptor
the descriptor of the constraint to validate
cd
)

Validate a deferred constraint.

private void
validateDeferredConstraints(final boolean rollbackOnError)

Validate all deferred constraints.

public void
validateStmtExecution(ConstantAction
the constantAction that is about to be executed (and should be validated
constantAction
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.validateStmtExecution.

Validate a statement.

public boolean

Returns:

boolean Found no open (held) resultsets.
verifyAllHeldResultSetsAreClosed
()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.verifyAllHeldResultSetsAreClosed.

Verify that there are no activations with open held result sets.

public boolean

Returns:

Nothing.
verifyNoOpenResultSets
(PreparedStatement
The prepared Statement
pStmt
,
Provider
The object precipitating a possible invalidation
provider
,
int
The action causing the possible invalidation
action
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.verifyNoOpenResultSets.

Verify that there are no activations with open result sets on the specified prepared statement.

public final void
xaCommit(boolean
if true, allow it to commit without first going thru a prepared state.
onePhase
)

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.xaCommit.

Same as userCommit except commit a distributed transaction.

public void
xaRollback()

Implements org.apache.derby.iapi.sql.conn.LanguageConnectionContext.xaRollback.

Same as userRollback() except rolls back a distrubuted transaction.

Inherited from org.apache.derby.iapi.services.context.ContextImpl:
getContextManagergetIdNamepopMepushMe