Class BaseActivation
- java.lang.Object
-
- org.apache.derby.impl.sql.execute.BaseActivation
-
- All Implemented Interfaces:
- Dependable, GeneratedByteCode, Activation, Dependent, CursorActivation
- Direct Known Subclasses:
- ConstantActionActivation, CursorActivation
public abstract class BaseActivation extends java.lang.Object implements CursorActivation, GeneratedByteCode
BaseActivation provides the fundamental support we expect all activations to have. Doesn't actually implement any of the activation interface, expects the subclasses to do that.
-
-
Field Summary
-
Fields inherited from interface org.apache.derby.catalog.Dependable
ACTIVATION, ALIAS, COLUMNS_IN_TABLE, COLUMNS_PERMISSION, CONGLOMERATE, CONSTRAINT, DEFAULT, FILE, HEAP, INDEX, PERM, PREPARED_STATEMENT, ROLE_GRANT, ROUTINE_PERMISSION, SCHEMA, SEQUENCE, STORED_PREPARED_STATEMENT, TABLE, TABLE_PERMISSION, TRIGGER, VIEW
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddWarning(java.sql.SQLWarning w)Add a warning to the activationstatic voidallocateQualArray(Qualifier[][] qualifiers, int position, int length)Allocate an array of qualifiers and initialize in Qualifier[][]booleancheckIfThisActivationHasHoldCursor(java.lang.String tableName)Temporary tables can be declared with ON COMMIT DELETE ROWS.voidcheckStatementValidity()Check the validity of the current executing statement.voidclearCurrentRow(int resultSetNumber)Clear the current row for the specified ResultSet.voidclearHeapConglomerateController()Clear the ConglomerateController to be used for an update or delete.voidclearIndexScanInfo()Clear the info for the index to be re-used for update/delete.voidclearParentResultSets()prepared statement use the same activation for multiple execution.voidclearWarnings()Clear the activation's warnings.voidclose()Closing an activation marks it as unusable.java.lang.Objecte0()java.lang.Objecte1()java.lang.Objecte2()java.lang.Objecte3()java.lang.Objecte4()java.lang.Objecte5()java.lang.Objecte6()java.lang.Objecte7()java.lang.Objecte8()java.lang.Objecte9()ResultSetexecute()When the prepared statement is executed, it passes execution on to the activation execution was requested for.int[]getAutoGeneratedKeysColumnIndexes()Returns the column positions array of columns requested in auto-generated keys resultset for this avtivation.java.lang.String[]getAutoGeneratedKeysColumnNames()Returns the column names array of columns requested in auto-generated keys resultset for this avtivation.booleangetAutoGeneratedKeysResultsetMode()Returns true if auto-generated keys resultset request was made for this avtivation.java.lang.StringgetClassType()Get the unique class id for the Dependable.ConstantActiongetConstantAction()Get the top ConstantAction on the stack without changing the stack.ContextManagergetContextManager()Get the Current ContextManager.java.sql.ConnectiongetCurrentConnection()Used to get a proxy for the current connection.RowgetCurrentRow(int resultSetNumber)Get the current row at the given index.NumberDataValuegetCurrentValueAndAdvance(java.lang.String sequenceUUIDstring, int typeFormatID)Called by generated code to get the next number in an ANSI/ISO sequence and advance the sequence.java.lang.StringgetCursorName()get the cursor name.CursorResultSetgetCursorResultSet()Used in CurrentOfResultSet to get to the cursor result set for a cursor.DataValueFactorygetDataValueFactory()Used by activations to generate data values.NumberDataValuegetDB2Length(DataValueDescriptor value, int constantLength, NumberDataValue reUse)Compute the DB2 compatible length of a value.TableDescriptorgetDDLTableDescriptor()Get the TableDescriptor for the target of DDL.DependableFindergetDependableFinder()Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.java.sql.ResultSet[][]getDynamicResults()Real implementations of this method are provided by a generated class.ExecutionFactorygetExecutionFactory()Used in activations for generating rows.booleangetForCreateTable()Get whether or not this activation is for create table.CursorResultSetgetForUpdateIndexScan()GeneratedClassgetGC()Get the GeneratedClass object for this object.ConglomerateControllergetHeapConglomerateController()Get the ConglomerateController, if any, that has already been opened for the heap when scaning for an update or delete.longgetIndexConglomerateNumber()Get the conglomerate number of the index, if any, that has already been opened for scaning for an update or delete.ScanControllergetIndexScanController()Get the ScanController, if any, that has already been opened for the index when scaning for an update or delete.LanguageConnectionContextgetLanguageConnectionContext()Get the language connection factory associated with this connectionintgetMaxDynamicResults()Real implementations of this method are provided by a generated class.longgetMaxRows()Get the maximum # of rows.GeneratedMethodgetMethod(java.lang.String methodName)intgetNumSubqueries()Get the number of subqueries in the entire query.UUIDgetObjectID()Get the UUID of this Dependable OBJECT.java.lang.StringgetObjectName()Get the name of this Dependable OBJECT.ParameterValueSetgetParameterValueSet()return the parameters.ActivationgetParentActivation()Get the activation of the calling statement or parent statement.java.util.Vector<TemporaryRowHolder>getParentResultSet(java.lang.String resultSetId)get the reference to parent table ResultSets, that will be needed by the referential action dependent table scans.java.util.Enumeration<java.lang.String>getParentResultSetKeys()ExecPreparedStatementgetPreparedStatement()Get the prepared statement that this activation is for.ResultDescriptiongetResultDescription()Get the result description for this activation, if it has one.ResultSetgetResultSet()Returns the current result set for this activation, i.e.ResultSetFactorygetResultSetFactory()Used in the execute method of activations for generating the result sets that they concatenate together.booleangetResultSetHoldability()Return the holdability of this activation.RowLocationgetRowLocationTemplate(int itemNumber)Get the saved RowLocation.booleangetScrollable()SQLSessionContextgetSQLSessionContextForChildren()Return the current SQL session context for all immediately nested connections stemming from the call or function invocation of the statement corresponding to this activation.CursorResultSetgetTargetResultSet()Used in CurrentOfResultSet to get to the target result set for a cursor.java.sql.ResultSetgetTargetVTI()Get the ResultSet for the target of an update/delete to a VTI.TransactionControllergetTransactionController()Get the Execution TransactionController associated with this activation/lcc.java.sql.SQLWarninggetWarnings()Returns the chained list of warnings.voidinformOfRowCount(NoPutResultSet resultSet, long currentRowCount)Tell this activation that the given ResultSet was found to have the given number of rows.voidinitFromContext(Context context)Initialize the generated class from a context.booleanisClosed()Find out if the activation closed or not.booleanisCursorActivation()Is this Activation for a cursor?booleanisInUse()Is the activation in use?booleanisPersistent()Return whether or not this Dependable is persistent.booleanisSingleExecution()Returns true if this Activation is only going to be used for one execution.booleanisValid()Check that all of the dependent's dependencies are valid.voidmakeInvalid(int action, LanguageConnectionContext lcc)Mark the dependent as invalid (due to at least one of its dependencies being invalid).voidmarkUnused()Mark the activation as unused.NoPutResultSetmaterializeResultSetIfPossible(NoPutResultSet rs)ConstantActionpopConstantAction()Pop the ConstantAction stack, returning the element which was just popped off the stack.voidprepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc)Prepare to mark the dependent as invalid (due to at least one of its dependencies being invalid).ConstantActionpushConstantAction(ConstantAction newConstantAction)Push a ConstantAction to be returned by getConstantAction().static voidreinitializeQualifiers(Qualifier[][] qualifiers)Reinitialize all Qualifiers in an array of Qualifiers.voidreset()This is a partial implementation of reset.voidsetAutoGeneratedKeysResultsetInfo(int[] columnIndexes, java.lang.String[] columnNames)Set the auto-generated keys resultset mode to true for this activation.static voidsetColumnPosition(int[] columnPositions, int positionToSet, int column)Set a column position in an array of column positions.voidsetCurrentRow(ExecRow currentRow, int resultSetNumber)Remember the row for the specified ResultSet.voidsetCursorName(java.lang.String cursorName)remember the cursor namevoidsetDDLTableDescriptor(TableDescriptor td)Save the TableDescriptor for the target of DDL so that it can be passed between the various ConstantActions during execution.voidsetForCreateTable()Mark the Activation as being for create table.voidsetForUpdateIndexScan(CursorResultSet forUpdateIndexScan)beetle 3865: updateable cursor using index.voidsetGC(GeneratedClass gc)Set the Generated Class.voidsetHeapConglomerateController(ConglomerateController updateHeapCC)Set the ConglomerateController to be used for an update or delete.voidsetIndexConglomerateNumber(long indexConglomerateNumber)Set the conglomerate number of the index to be used for an update or delete, when scanning an index that will also be updated (Saves opening the ScanController twice.)voidsetIndexScanController(ScanController indexSC)Set the ScanController to be used for an update or delete, when scanning an index that will also be updated (Saves opening the ScanController twice.)voidsetMaxRows(long maxRows)Set the maximum # of rows.voidsetParameters(ParameterValueSet parameterValues, DataTypeDescriptor[] parameterTypes)Sets the parameter values for this execution of the statement.voidsetParentActivation(Activation a)This activation is created in a dynamic call context or a substatement execution context, make note of its parent statements activation (a).voidsetParentResultSet(TemporaryRowHolder rs, java.lang.String resultSetId)static voidsetQualifier(Qualifier[][] qualifiers, Qualifier qualifier, int position_1, int position_2)Set a Qualifier in a 2 dimensional array of Qualifiers.voidsetResultSetHoldability(boolean resultSetHoldability)Set current resultset holdability.voidsetSingleExecution()Set this Activation for a single execution.voidsetTargetVTI(java.sql.ResultSet targetVTI)Save the ResultSet for the target of an update/delete to a VTI.voidsetupActivation(ExecPreparedStatement ps, boolean scrollable)Link this activation with its PreparedStatement.SQLSessionContextsetupSQLSessionContextForChildren(boolean push)Set up and return the current SQL session context for all immediately nested connections stemming from the call or function invocation of the statement corresponding to this activation (push=true) or for a substatement, which shares the parents statement's session context (push=false).voidthrowIfClosed(java.lang.String op)Various activation methods need to disallow their invocation if the activation is closed.voidthrowIfMissingParms()Throw an exception if any parameters are uninitialized.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.derby.iapi.services.loader.GeneratedByteCode
postConstructor
-
-
-
-
Method Detail
-
initFromContext
public final void initFromContext(Context context) throws StandardException
Description copied from interface:GeneratedByteCodeInitialize the generated class from a context. Called by the class manager just after creating the instance of the new class.- Specified by:
initFromContextin interfaceGeneratedByteCode- Throws:
StandardException
-
execute
public final ResultSet execute() throws StandardException
Description copied from interface:ActivationWhen the prepared statement is executed, it passes execution on to the activation execution was requested for.- Specified by:
executein interfaceActivation- Returns:
- the ResultSet for further manipulation, if any.
- Throws:
StandardException- Thrown on failure
-
getPreparedStatement
public final ExecPreparedStatement getPreparedStatement()
Description copied from interface:ActivationGet the prepared statement that this activation is for.- Specified by:
getPreparedStatementin interfaceActivation- Returns:
- the prepared statement this activation is for.
-
pushConstantAction
public ConstantAction pushConstantAction(ConstantAction newConstantAction)
Description copied from interface:ActivationPush a ConstantAction to be returned by getConstantAction(). Returns the newConstantAction.- Specified by:
pushConstantActionin interfaceActivation
-
popConstantAction
public ConstantAction popConstantAction()
Description copied from interface:ActivationPop the ConstantAction stack, returning the element which was just popped off the stack.- Specified by:
popConstantActionin interfaceActivation
-
getConstantAction
public ConstantAction getConstantAction()
Description copied from interface:ActivationGet the top ConstantAction on the stack without changing the stack.- Specified by:
getConstantActionin interfaceActivation
-
checkStatementValidity
public final void checkStatementValidity() throws StandardExceptionDescription copied from interface:ActivationCheck the validity of the current executing statement. Needs to be called after a statement has obtained the relevant table locks on the- Specified by:
checkStatementValidityin interfaceActivation- Throws:
StandardException
-
setupActivation
public final void setupActivation(ExecPreparedStatement ps, boolean scrollable) throws StandardException
Link this activation with its PreparedStatement. It can be called with null to break the link with the PreparedStatement.- Parameters:
ps- prepared statementscrollable- activation for a scrollable result set- Throws:
StandardException- standard error policy
-
getResultSet
public ResultSet getResultSet()
Description copied from interface:ActivationReturns the current result set for this activation, i.e. the one returned by the last execute() call. If there has been no execute call or the activation has been reset or closed, a null is returned.- Specified by:
getResultSetin interfaceActivation- Returns:
- the current ResultSet of this activation.
-
getRowLocationTemplate
public RowLocation getRowLocationTemplate(int itemNumber)
Get the saved RowLocation.- Specified by:
getRowLocationTemplatein interfaceActivation- Parameters:
itemNumber- The saved item number.- Returns:
- A RowLocation template for the conglomerate
-
getResultDescription
public ResultDescription getResultDescription()
Description copied from interface:ActivationGet the result description for this activation, if it has one.- Specified by:
getResultDescriptionin interfaceActivation- Returns:
- result description for this activation, if it has one; otherwise, null.
-
reset
public void reset() throws StandardExceptionThis is a partial implementation of reset. Subclasses will want to reset information they are aware of, such as parameters.All subclasses must call super.reset() and then do their cleanup.
The execute call must set the resultSet field to be the resultSet that it has returned.
- Specified by:
resetin interfaceActivation- Throws:
StandardException- on error
-
close
public final void close() throws StandardExceptionClosing an activation marks it as unusable. Any other requests made on it will fail. An activation should be marked closed when it is expected to not be used any longer, i.e. when the connection for it is closed, or it has suffered some sort of severe error. This should also remove it from the language connection context.- Specified by:
closein interfaceActivation- Throws:
StandardException- on error
-
isClosed
public boolean isClosed()
Find out if the activation closed or not.- Specified by:
isClosedin interfaceActivation- Returns:
- true if the prepared statement has been closed.
-
setSingleExecution
public void setSingleExecution()
Set this Activation for a single execution.- Specified by:
setSingleExecutionin interfaceActivation- See Also:
Activation.setSingleExecution()
-
isSingleExecution
public boolean isSingleExecution()
Returns true if this Activation is only going to be used for one execution.- Specified by:
isSingleExecutionin interfaceActivation- See Also:
Activation.isSingleExecution()
-
getNumSubqueries
public int getNumSubqueries()
Get the number of subqueries in the entire query.- Specified by:
getNumSubqueriesin interfaceActivation- Returns:
- int The number of subqueries in the entire query.
-
isCursorActivation
public boolean isCursorActivation()
Description copied from interface:ActivationIs this Activation for a cursor?- Specified by:
isCursorActivationin interfaceActivation- Returns:
- Whether or not this Activation is for a cursor.
- See Also:
Activation.isCursorActivation()
-
setGC
public final void setGC(GeneratedClass gc)
Description copied from interface:GeneratedByteCodeSet the Generated Class. Call by the class manager just after calling initFromContext.- Specified by:
setGCin interfaceGeneratedByteCode
-
getGC
public final GeneratedClass getGC()
Description copied from interface:GeneratedByteCodeGet the GeneratedClass object for this object.- Specified by:
getGCin interfaceGeneratedByteCode
-
getMethod
public final GeneratedMethod getMethod(java.lang.String methodName) throws StandardException
- Specified by:
getMethodin interfaceGeneratedByteCode- Throws:
StandardException
-
e0
public java.lang.Object e0() throws StandardException- Specified by:
e0in interfaceGeneratedByteCode- Throws:
StandardException
-
e1
public java.lang.Object e1() throws StandardException- Specified by:
e1in interfaceGeneratedByteCode- Throws:
StandardException
-
e2
public java.lang.Object e2() throws StandardException- Specified by:
e2in interfaceGeneratedByteCode- Throws:
StandardException
-
e3
public java.lang.Object e3() throws StandardException- Specified by:
e3in interfaceGeneratedByteCode- Throws:
StandardException
-
e4
public java.lang.Object e4() throws StandardException- Specified by:
e4in interfaceGeneratedByteCode- Throws:
StandardException
-
e5
public java.lang.Object e5() throws StandardException- Specified by:
e5in interfaceGeneratedByteCode- Throws:
StandardException
-
e6
public java.lang.Object e6() throws StandardException- Specified by:
e6in interfaceGeneratedByteCode- Throws:
StandardException
-
e7
public java.lang.Object e7() throws StandardException- Specified by:
e7in interfaceGeneratedByteCode- Throws:
StandardException
-
e8
public java.lang.Object e8() throws StandardException- Specified by:
e8in interfaceGeneratedByteCode- Throws:
StandardException
-
e9
public java.lang.Object e9() throws StandardException- Specified by:
e9in interfaceGeneratedByteCode- Throws:
StandardException
-
checkIfThisActivationHasHoldCursor
public boolean checkIfThisActivationHasHoldCursor(java.lang.String tableName)
Temporary tables can be declared with ON COMMIT DELETE ROWS. But if the table has a held curosr open at commit time, data should not be deleted from the table. This method, (gets called at commit time) checks if this activation held cursor and if so, does that cursor reference the passed temp table name.- Specified by:
checkIfThisActivationHasHoldCursorin interfaceActivation- Returns:
- true if this activation has held cursor and if it references the passed temp table name
-
setCursorName
public void setCursorName(java.lang.String cursorName)
remember the cursor name- Specified by:
setCursorNamein interfaceActivation- Parameters:
cursorName- The cursor name to use.
-
getCursorName
public java.lang.String getCursorName()
get the cursor name. For something that isn't a cursor, this is used as a string name of the result set for messages from things like the dependency manager.Activations that do support cursors will override this.
- Specified by:
getCursorNamein interfaceActivation- Returns:
- The cursor name.
-
setResultSetHoldability
public void setResultSetHoldability(boolean resultSetHoldability)
Description copied from interface:ActivationSet current resultset holdability.- Specified by:
setResultSetHoldabilityin interfaceActivation- Parameters:
resultSetHoldability- The new resultset holdability.
-
getResultSetHoldability
public boolean getResultSetHoldability()
Description copied from interface:ActivationReturn the holdability of this activation.- Specified by:
getResultSetHoldabilityin interfaceActivation- Returns:
- The holdability of this activation.
-
setAutoGeneratedKeysResultsetInfo
public void setAutoGeneratedKeysResultsetInfo(int[] columnIndexes, java.lang.String[] columnNames)Description copied from interface:ActivationSet the auto-generated keys resultset mode to true for this activation. The specific columns for auto-generated keys resultset can be requested by passing column positions array The specific columns for auto-generated keys resultset can be requested by passing column names array Both the parameters would be null if user didn't request specific keys. Otherwise, the user could request specific columns by passing column positions or names array but not both.- Specified by:
setAutoGeneratedKeysResultsetInfoin interfaceActivation- Parameters:
columnIndexes- Request specific columns in auto-generated keys resultset by passing column positions. null means no specific columns requested by positioncolumnNames- Request specific columns in auto-generated keys resultset by passing column names. null means no specific columns requested by position- See Also:
Activation.setAutoGeneratedKeysResultsetInfo(int[], java.lang.String[])
-
getAutoGeneratedKeysResultsetMode
public boolean getAutoGeneratedKeysResultsetMode()
Description copied from interface:ActivationReturns true if auto-generated keys resultset request was made for this avtivation.- Specified by:
getAutoGeneratedKeysResultsetModein interfaceActivation- Returns:
- auto-generated keys resultset mode for this activation.
- See Also:
Activation.getAutoGeneratedKeysResultsetMode()
-
getAutoGeneratedKeysColumnIndexes
public int[] getAutoGeneratedKeysColumnIndexes()
Description copied from interface:ActivationReturns the column positions array of columns requested in auto-generated keys resultset for this avtivation. Returns null if no specific column requested by positions- Specified by:
getAutoGeneratedKeysColumnIndexesin interfaceActivation- Returns:
- column positions array of columns requested.
- See Also:
Activation.getAutoGeneratedKeysColumnIndexes()
-
getAutoGeneratedKeysColumnNames
public java.lang.String[] getAutoGeneratedKeysColumnNames()
Description copied from interface:ActivationReturns the column names array of columns requested in auto-generated keys resultset for this avtivation. Returns null if no specific column requested by names- Specified by:
getAutoGeneratedKeysColumnNamesin interfaceActivation- Returns:
- column names array of columns requested.
- See Also:
Activation.getAutoGeneratedKeysColumnNames()
-
getResultSetFactory
public final ResultSetFactory getResultSetFactory()
Used in the execute method of activations for generating the result sets that they concatenate together.
-
getExecutionFactory
public final ExecutionFactory getExecutionFactory()
Used in activations for generating rows.- Specified by:
getExecutionFactoryin interfaceActivation- Returns:
- ExecutionFactory
-
getTargetResultSet
public CursorResultSet getTargetResultSet()
Used in CurrentOfResultSet to get to the target result set for a cursor. Overridden by activations generated for updatable cursors. Those activations capture the target result set in a field in their execute() method, and then return the value of that field in their version of this method.- Specified by:
getTargetResultSetin interfaceCursorActivation- Returns:
- null.
-
getCurrentValueAndAdvance
public NumberDataValue getCurrentValueAndAdvance(java.lang.String sequenceUUIDstring, int typeFormatID) throws StandardException
Called by generated code to get the next number in an ANSI/ISO sequence and advance the sequence. Raises an exception if the sequence was declared NO CYCLE and its range is exhausted.- Specified by:
getCurrentValueAndAdvancein interfaceActivation- Parameters:
sequenceUUIDstring- The string value of the sequence's UUIDtypeFormatID- The format id of the data type to be returned. E.g., StoredFormatIds.SQL_INTEGER_ID.- Returns:
- The next number in the sequence
- Throws:
StandardException
-
getCursorResultSet
public CursorResultSet getCursorResultSet()
Used in CurrentOfResultSet to get to the cursor result set for a cursor. Overridden by activations generated for updatable cursors. Those activations capture the cursor result set in a field in their execute() method, and then return the value of that field in their version of this method.- Specified by:
getCursorResultSetin interfaceCursorActivation- Returns:
- null
-
throwIfClosed
public void throwIfClosed(java.lang.String op) throws StandardExceptionVarious activation methods need to disallow their invocation if the activation is closed. This lets them check and throw without generating alot of code.The code to write to generate the call to this is approximately:
// jf is a JavaFactory CallableExpression ce = jf.newMethodCall( jf.thisExpression(), BaseActivation.CLASS_NAME, "throwIfClosed", "void", acb.exprArray(jf.newStringLiteral(...some literal here...))); //mb is a MethodBuilder mb.addStatement(jf.newStatement(ce)); The java code to write to call this is:this.throwIfClosed(...some literal here...); In both cases, "...some literal here..." gets replaced with an expression of type String that evaluates to the name of the operation that is being checked, like "execute" or "reset".- Throws:
StandardException- thrown if closed
-
setColumnPosition
public static void setColumnPosition(int[] columnPositions, int positionToSet, int column)Set a column position in an array of column positions.- Parameters:
columnPositions- The array of column positionspositionToSet- The place to put the column positioncolumn- The column position
-
allocateQualArray
public static void allocateQualArray(Qualifier[][] qualifiers, int position, int length)
Allocate an array of qualifiers and initialize in Qualifier[][]- Parameters:
qualifiers- The array of Qualifier arrays.position- The position in the array to setlength- The array length of the qualifier array to allocate.
-
setQualifier
public static void setQualifier(Qualifier[][] qualifiers, Qualifier qualifier, int position_1, int position_2)
Set a Qualifier in a 2 dimensional array of Qualifiers. Set a single Qualifier into one slot of a 2 dimensional array of Qualifiers. @see Qualifier for detailed description of layout of the 2-d array.- Parameters:
qualifiers- The array of Qualifiersqualifier- The Qualifierposition_1- The Nth array index into qualifiers[N][M]position_2- The Nth array index into qualifiers[N][M]
-
reinitializeQualifiers
public static void reinitializeQualifiers(Qualifier[][] qualifiers)
Reinitialize all Qualifiers in an array of Qualifiers.- Parameters:
qualifiers- The array of Qualifiers
-
markUnused
public final void markUnused()
Mark the activation as unused.- Specified by:
markUnusedin interfaceActivation
-
isInUse
public final boolean isInUse()
Is the activation in use?- Specified by:
isInUsein interfaceActivation- Returns:
- true/false
-
addWarning
public void addWarning(java.sql.SQLWarning w)
Description copied from interface:ActivationAdd a warning to the activation- Specified by:
addWarningin interfaceActivation- See Also:
Activation.addWarning(java.sql.SQLWarning)
-
getWarnings
public java.sql.SQLWarning getWarnings()
Description copied from interface:ActivationReturns the chained list of warnings. Returns null if there are no warnings.- Specified by:
getWarningsin interfaceActivation- See Also:
Activation.getWarnings()
-
clearWarnings
public void clearWarnings()
Description copied from interface:ActivationClear the activation's warnings.- Specified by:
clearWarningsin interfaceActivation- See Also:
Activation.clearWarnings()
-
informOfRowCount
public void informOfRowCount(NoPutResultSet resultSet, long currentRowCount) throws StandardException
Description copied from interface:ActivationTell this activation that the given ResultSet was found to have the given number of rows. This is used during execution to determine whether a table has grown or shrunk. If a table's size changes significantly, the activation may invalidate its PreparedStatement to force recompilation. Note that the association of row counts with ResultSets is kept in the activation class, not in the activation itself. This means that this method must be synchronized. This method is not required to check the number of rows on each call. Because of synchronization, this check is likely to be expensive, so it may only check every hundred calls or so.- Specified by:
informOfRowCountin interfaceActivation- Throws:
StandardException- Thrown on error- See Also:
Activation.informOfRowCount(org.apache.derby.iapi.sql.execute.NoPutResultSet, long)
-
getHeapConglomerateController
public ConglomerateController getHeapConglomerateController()
Description copied from interface:ActivationGet the ConglomerateController, if any, that has already been opened for the heap when scaning for an update or delete. (Saves opening the ConglomerateController twice.)- Specified by:
getHeapConglomerateControllerin interfaceActivation- Returns:
- The ConglomerateController, if available, to use for the update.
- See Also:
Activation.getHeapConglomerateController()
-
setHeapConglomerateController
public void setHeapConglomerateController(ConglomerateController updateHeapCC)
Description copied from interface:ActivationSet the ConglomerateController to be used for an update or delete. (Saves opening the ConglomerateController twice.)- Specified by:
setHeapConglomerateControllerin interfaceActivation- Parameters:
updateHeapCC- The ConglomerateController to reuse for the update or delete.- See Also:
Activation.setHeapConglomerateController(org.apache.derby.iapi.store.access.ConglomerateController)
-
clearHeapConglomerateController
public void clearHeapConglomerateController()
Description copied from interface:ActivationClear the ConglomerateController to be used for an update or delete. (Saves opening the ConglomerateController twice.)- Specified by:
clearHeapConglomerateControllerin interfaceActivation- See Also:
Activation.clearHeapConglomerateController()
-
getIndexScanController
public ScanController getIndexScanController()
Description copied from interface:ActivationGet the ScanController, if any, that has already been opened for the index when scaning for an update or delete. (Saves opening the ScanController twice.)- Specified by:
getIndexScanControllerin interfaceActivation- Returns:
- The ScanController, if available, to use for the update.
- See Also:
Activation.getIndexScanController()
-
setIndexScanController
public void setIndexScanController(ScanController indexSC)
Description copied from interface:ActivationSet the ScanController to be used for an update or delete, when scanning an index that will also be updated (Saves opening the ScanController twice.)- Specified by:
setIndexScanControllerin interfaceActivation- Parameters:
indexSC- The ScanController to reuse for the update or delete.- See Also:
Activation.setIndexScanController(org.apache.derby.iapi.store.access.ScanController)
-
getIndexConglomerateNumber
public long getIndexConglomerateNumber()
Description copied from interface:ActivationGet the conglomerate number of the index, if any, that has already been opened for scaning for an update or delete. (Saves opening the ScanController twice.)- Specified by:
getIndexConglomerateNumberin interfaceActivation- Returns:
- The conglomerate number, if available, to use for the update.
- See Also:
Activation.getIndexConglomerateNumber()
-
setIndexConglomerateNumber
public void setIndexConglomerateNumber(long indexConglomerateNumber)
Description copied from interface:ActivationSet the conglomerate number of the index to be used for an update or delete, when scanning an index that will also be updated (Saves opening the ScanController twice.)- Specified by:
setIndexConglomerateNumberin interfaceActivation- Parameters:
indexConglomerateNumber- The conglomerate number of the index to reuse for the update or delete.- See Also:
Activation.setIndexConglomerateNumber(long)
-
clearIndexScanInfo
public void clearIndexScanInfo()
Description copied from interface:ActivationClear the info for the index to be re-used for update/delete. (ScanController and conglomerate number.)- Specified by:
clearIndexScanInfoin interfaceActivation- See Also:
Activation.clearIndexScanInfo()
-
setForCreateTable
public void setForCreateTable()
Description copied from interface:ActivationMark the Activation as being for create table. (NOTE: We can do certain optimizations for create table that we can't do for other DDL.)- Specified by:
setForCreateTablein interfaceActivation- See Also:
Activation.setForCreateTable()
-
getForCreateTable
public boolean getForCreateTable()
Description copied from interface:ActivationGet whether or not this activation is for create table. (NOTE: We can do certain optimizations for create table that we can't do for other DDL.)- Specified by:
getForCreateTablein interfaceActivation- Returns:
- Whether or not this activation is for create table.
- See Also:
Activation.getForCreateTable()
-
setDDLTableDescriptor
public void setDDLTableDescriptor(TableDescriptor td)
Description copied from interface:ActivationSave the TableDescriptor for the target of DDL so that it can be passed between the various ConstantActions during execution.- Specified by:
setDDLTableDescriptorin interfaceActivation- See Also:
Activation.setDDLTableDescriptor(org.apache.derby.iapi.sql.dictionary.TableDescriptor)
-
getDDLTableDescriptor
public TableDescriptor getDDLTableDescriptor()
Description copied from interface:ActivationGet the TableDescriptor for the target of DDL.- Specified by:
getDDLTableDescriptorin interfaceActivation- Returns:
- The TableDescriptor for the target of DDL.
- See Also:
Activation.getDDLTableDescriptor()
-
setMaxRows
public void setMaxRows(long maxRows)
Description copied from interface:ActivationSet the maximum # of rows. (# of rows that can be returned by a ResultSet. 0 means no limit.)- Specified by:
setMaxRowsin interfaceActivation- Parameters:
maxRows- Maximum # of rows. (0 means no limit.)- See Also:
Activation.setMaxRows(long)
-
getMaxRows
public long getMaxRows()
Description copied from interface:ActivationGet the maximum # of rows. (# of rows that can be returned by a ResultSet. 0 means no limit.)- Specified by:
getMaxRowsin interfaceActivation- Returns:
- Maximum # of rows. (0 means no limit.)
- See Also:
Activation.getMaxRows()
-
setTargetVTI
public void setTargetVTI(java.sql.ResultSet targetVTI)
Description copied from interface:ActivationSave the ResultSet for the target of an update/delete to a VTI.- Specified by:
setTargetVTIin interfaceActivation
-
getTargetVTI
public java.sql.ResultSet getTargetVTI()
Description copied from interface:ActivationGet the ResultSet for the target of an update/delete to a VTI.- Specified by:
getTargetVTIin interfaceActivation- Returns:
- The ResultSet for the target of an update/delete to a VTI.
-
getScrollable
public final boolean getScrollable()
-
getParameterValueSet
public ParameterValueSet getParameterValueSet()
return the parameters.- Specified by:
getParameterValueSetin interfaceActivation- Returns:
- The ParameterValueSet for this execution of the statement. Returns NULL if there are no parameters.
-
setParameters
public void setParameters(ParameterValueSet parameterValues, DataTypeDescriptor[] parameterTypes) throws StandardException
Description copied from interface:ActivationSets the parameter values for this execution of the statement.Has no effect if the activation has been closed.
NOTE: The setParameters() method is currently unimplemented. A statement with parameters will generate its own ParameterValueSet, which can be gotten with the getParameterValueSet() method (above). The idea behind setParameters() is to improve performance when operating across a network by allowing all the parameters to be set in one call, as opposed to one call per parameter.
- Specified by:
setParametersin interfaceActivation- Parameters:
parameterValues- The values of the parameters.- Throws:
StandardException
-
throwIfMissingParms
public void throwIfMissingParms() throws StandardExceptionThrow an exception if any parameters are uninitialized.- Throws:
StandardException- Thrown if any parameters are unitialized
-
setCurrentRow
public void setCurrentRow(ExecRow currentRow, int resultSetNumber)
Remember the row for the specified ResultSet.- Specified by:
setCurrentRowin interfaceActivation- Parameters:
currentRow- The row to be operated upon.resultSetNumber- The resultSetNumber for the current ResultSet
-
clearCurrentRow
public void clearCurrentRow(int resultSetNumber)
Clear the current row for the specified ResultSet.- Specified by:
clearCurrentRowin interfaceActivation- Parameters:
resultSetNumber- The resultSetNumber for the current ResultSet
-
getCurrentRow
public Row getCurrentRow(int resultSetNumber)
Get the current row at the given index.- Specified by:
getCurrentRowin interfaceActivation
-
getSQLSessionContextForChildren
public SQLSessionContext getSQLSessionContextForChildren()
Return the current SQL session context for all immediately nested connections stemming from the call or function invocation of the statement corresponding to this activation. Substatements (e.g. used in rs.updateRow), inherit the SQL session context via its parent activation.- Specified by:
getSQLSessionContextForChildrenin interfaceActivation- See Also:
Activation.getSQLSessionContextForChildren()
-
setupSQLSessionContextForChildren
public SQLSessionContext setupSQLSessionContextForChildren(boolean push)
Description copied from interface:ActivationSet up and return the current SQL session context for all immediately nested connections stemming from the call or function invocation of the statement corresponding to this activation (push=true) or for a substatement, which shares the parents statement's session context (push=false).- Specified by:
setupSQLSessionContextForChildrenin interfaceActivation- Parameters:
push- true if used to push a new connection context- See Also:
Activation.setupSQLSessionContextForChildren(boolean)
-
setParentActivation
public void setParentActivation(Activation a)
This activation is created in a dynamic call context or a substatement execution context, make note of its parent statements activation (a).- Specified by:
setParentActivationin interfaceActivation- Parameters:
a- The caller's or superstatement's activation
-
getParentActivation
public Activation getParentActivation()
Get the activation of the calling statement or parent statement.- Specified by:
getParentActivationin interfaceActivation- Returns:
- The parent's activation
-
materializeResultSetIfPossible
public NoPutResultSet materializeResultSetIfPossible(NoPutResultSet rs) throws StandardException
- Throws:
StandardException
-
setParentResultSet
public void setParentResultSet(TemporaryRowHolder rs, java.lang.String resultSetId)
- Specified by:
setParentResultSetin interfaceActivation
-
getParentResultSet
public java.util.Vector<TemporaryRowHolder> getParentResultSet(java.lang.String resultSetId)
get the reference to parent table ResultSets, that will be needed by the referential action dependent table scans.- Specified by:
getParentResultSetin interfaceActivation
-
getParentResultSetKeys
public java.util.Enumeration<java.lang.String> getParentResultSetKeys()
- Specified by:
getParentResultSetKeysin interfaceActivation
-
clearParentResultSets
public void clearParentResultSets()
prepared statement use the same activation for multiple execution. For each excution we create new set of temporary resultsets, we should clear this hash table. otherwise we will refer to the released resources.- Specified by:
clearParentResultSetsin interfaceActivation
-
setForUpdateIndexScan
public void setForUpdateIndexScan(CursorResultSet forUpdateIndexScan)
beetle 3865: updateable cursor using index. A way of communication between cursor activation and update activation.- Specified by:
setForUpdateIndexScanin interfaceActivation
-
getForUpdateIndexScan
public CursorResultSet getForUpdateIndexScan()
- Specified by:
getForUpdateIndexScanin interfaceActivation
-
getLanguageConnectionContext
public final LanguageConnectionContext getLanguageConnectionContext()
Get the language connection factory associated with this connection- Specified by:
getLanguageConnectionContextin interfaceActivation
-
getTransactionController
public final TransactionController getTransactionController()
Description copied from interface:ActivationGet the Execution TransactionController associated with this activation/lcc.- Specified by:
getTransactionControllerin interfaceActivation
-
getContextManager
public ContextManager getContextManager()
Get the Current ContextManager.- Returns:
- Current ContextManager
-
getDataValueFactory
public DataValueFactory getDataValueFactory()
Used by activations to generate data values. Most DML statements will use this method. Possibly some DDL statements will, as well.- Specified by:
getDataValueFactoryin interfaceActivation- Returns:
- DataValueFactory
-
getCurrentConnection
public java.sql.Connection getCurrentConnection() throws java.sql.SQLExceptionUsed to get a proxy for the current connection.- Throws:
java.sql.SQLException- Thrown on failure to get connection
-
getDynamicResults
public java.sql.ResultSet[][] getDynamicResults()
Real implementations of this method are provided by a generated class.- Specified by:
getDynamicResultsin interfaceActivation- Returns:
- null if no dynamic results exists. Otherwise an array of ResultSet arrays, each of length one containing null or a reference to a ResultSet.
-
getMaxDynamicResults
public int getMaxDynamicResults()
Real implementations of this method are provided by a generated class.- Specified by:
getMaxDynamicResultsin interfaceActivation
-
getDB2Length
public NumberDataValue getDB2Length(DataValueDescriptor value, int constantLength, NumberDataValue reUse) throws StandardException
Compute the DB2 compatible length of a value.- Parameters:
value-constantLength- The length, if it is a constant modulo null/not null. -1 if the length is not constantreUse- If non-null then re-use this as a container for the length- Returns:
- the DB2 compatible length, set to null if value is null.
- Throws:
StandardException
-
getDependableFinder
public DependableFinder getDependableFinder()
Description copied from interface:DependableGet an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.- Specified by:
getDependableFinderin interfaceDependable- Returns:
- A Finder object that can be written to disk if this is a Persistent Dependable. Null if this is not a persistent dependable.
- See Also:
Dependable.getDependableFinder()
-
getObjectName
public java.lang.String getObjectName()
Description copied from interface:DependableGet the name of this Dependable OBJECT. This is useful for diagnostic messages.- Specified by:
getObjectNamein interfaceDependable- Returns:
- Name of Dependable OBJECT.
- See Also:
Dependable.getObjectName()
-
getObjectID
public UUID getObjectID()
Description copied from interface:DependableGet the UUID of this Dependable OBJECT.- Specified by:
getObjectIDin interfaceDependable- Returns:
- UUID of this OBJECT.
- See Also:
Dependable.getObjectID()
-
getClassType
public java.lang.String getClassType()
Description copied from interface:DependableGet the unique class id for the Dependable. Every Dependable belongs to a class of Dependables.- Specified by:
getClassTypein interfaceDependable- Returns:
- type of this Dependable.
- See Also:
Dependable.getClassType()
-
isPersistent
public boolean isPersistent()
Description copied from interface:DependableReturn whether or not this Dependable is persistent. Persistent dependencies are stored in SYS.SYSDEPENDS.- Specified by:
isPersistentin interfaceDependable- Returns:
- true if this Dependable is persistent.
- See Also:
Dependable.isPersistent()
-
isValid
public boolean isValid()
Description copied from interface:DependentCheck that all of the dependent's dependencies are valid.- Specified by:
isValidin interfaceDependent- Returns:
- true if the dependent is currently valid
- See Also:
Dependent.isValid()
-
makeInvalid
public void makeInvalid(int action, LanguageConnectionContext lcc) throws StandardExceptionDescription copied from interface:DependentMark the dependent as invalid (due to at least one of its dependencies being invalid).- Specified by:
makeInvalidin interfaceDependent- Parameters:
action- The action causing the invalidationlcc- The LanguageConnectionContext- Throws:
StandardException- thrown if unable to make it invalid- See Also:
Dependent.makeInvalid(int, org.apache.derby.iapi.sql.conn.LanguageConnectionContext)
-
prepareToInvalidate
public void prepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc) throws StandardException
Description copied from interface:DependentPrepare to mark the dependent as invalid (due to at least one of its dependencies being invalid).- Specified by:
prepareToInvalidatein interfaceDependent- Parameters:
p- the provideraction- The action causing the invalidationlcc- The LanguageConnectionContext- Throws:
StandardException- thrown if unable to make it invalid- See Also:
Dependent.prepareToInvalidate(org.apache.derby.iapi.sql.depend.Provider, int, org.apache.derby.iapi.sql.conn.LanguageConnectionContext)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG