public final class GenericActivationHolder extends java.lang.Object implements Activation
Modifier and Type | Field and Description |
---|---|
BaseActivation |
ac |
(package private) GeneratedClass |
gc |
private LanguageConnectionContext |
lcc |
(package private) DataTypeDescriptor[] |
paramTypes |
(package private) ExecPreparedStatement |
ps |
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
Constructor and Description |
---|
GenericActivationHolder(LanguageConnectionContext lcc,
GeneratedClass gc,
ExecPreparedStatement ps,
boolean scrollable)
Constructor for an ActivationHolder
|
Modifier and Type | Method and Description |
---|---|
void |
addWarning(java.sql.SQLWarning w)
Add a warning to the activation
|
boolean |
checkIfThisActivationHasHoldCursor(java.lang.String tableName)
Temporary tables can be declared with ON COMMIT DELETE ROWS.
|
void |
checkStatementValidity()
Check the validity of the current executing statement.
|
void |
clearCurrentRow(int resultSetNumber)
Generated plans have a current row field for ease in defining
the methods and finding them dynamically.
|
void |
clearHeapConglomerateController()
Clear the ConglomerateController to be used for an update or delete.
|
void |
clearIndexScanInfo()
Clear the info for the index to be re-used for update/delete.
|
void |
clearParentResultSets() |
void |
clearWarnings()
Clear the activation's warnings.
|
void |
close()
Closing an activation statement marks it as unusable.
|
ResultSet |
execute()
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.
|
boolean |
getAutoGeneratedKeysResultsetMode()
Returns true if auto-generated keys resultset request was made for this
avtivation.
|
java.lang.String |
getClassType()
Get the unique class id for the Dependable.
|
ConstantAction |
getConstantAction()
Get the top ConstantAction on the stack without changing the stack.
|
Row |
getCurrentRow(int resultSetNumber)
Get the current row at the given index.
|
NumberDataValue |
getCurrentValueAndAdvance(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.String |
getCursorName()
Return the cursor name of this activation.
|
DataValueFactory |
getDataValueFactory()
Get the DataValueFactory
|
TableDescriptor |
getDDLTableDescriptor()
Get the TableDescriptor for the target of
DDL.
|
DependableFinder |
getDependableFinder()
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()
Return the set of dynamical created result sets, for procedures.
|
ExecutionFactory |
getExecutionFactory()
Get the ExecutionFactory
|
boolean |
getForCreateTable()
Get whether or not this activation is for
create table.
|
CursorResultSet |
getForUpdateIndexScan() |
ConglomerateController |
getHeapConglomerateController()
Get the ConglomerateController, if any, that has already
been opened for the heap when scaning for an update or delete.
|
long |
getIndexConglomerateNumber()
Get the conglomerate number of the index, if any, that has already
been opened for scaning for an update or delete.
|
ScanController |
getIndexScanController()
Get the ScanController, if any, that has already
been opened for the index when scaning for an update or delete.
|
LanguageConnectionContext |
getLanguageConnectionContext()
Get the language connection context associated with this activation
|
int |
getMaxDynamicResults()
Return the maximum number of dynamical created result sets from the procedure definition.
|
long |
getMaxRows()
Get the maximum # of rows. (# of rows that can
be returned by a ResultSet. 0 means no limit.)
|
int |
getNumSubqueries()
Get the number of subqueries in the entire query.
|
UUID |
getObjectID()
Get the UUID of this Dependable OBJECT.
|
java.lang.String |
getObjectName()
Get the name of this Dependable OBJECT.
|
ParameterValueSet |
getParameterValueSet()
Gets the ParameterValueSet for this execution of the statement.
|
Activation |
getParentActivation()
This activation is created in a dynamic call context, or substatement
execution context; get its caller's or superstatement's activation.
|
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() |
ExecPreparedStatement |
getPreparedStatement()
Get the prepared statement that this activation is for.
|
ResultDescription |
getResultDescription()
Get the result description for this activation, if it has one.
|
ResultSet |
getResultSet()
Returns the current result set for this activation, i.e.
|
boolean |
getResultSetHoldability()
Return the holdability of this activation.
|
RowLocation |
getRowLocationTemplate(int itemNumber)
Get the saved RowLocation.
|
SQLSessionContext |
getSQLSessionContextForChildren()
Get the current SQL session context if in a nested connection of a
stored routine or in a substatement.
|
java.sql.ResultSet |
getTargetVTI()
Get the ResultSet for the target
of an update/delete to a VTI.
|
TransactionController |
getTransactionController()
Get the Execution TransactionController associated with this
activation/lcc.
|
java.sql.SQLWarning |
getWarnings()
Returns the chained list of warnings.
|
void |
informOfRowCount(NoPutResultSet resultSet,
long rowCount)
Tell this activation that the given ResultSet was found to have
the given number of rows.
|
boolean |
isClosed()
Find out if the activation is closed or not.
|
boolean |
isCursorActivation()
Is this Activation for a cursor?
|
boolean |
isInUse()
Is the activation in use?
|
boolean |
isPersistent()
Return whether or not this Dependable is persistent.
|
boolean |
isSingleExecution()
Is the activation set up for a single execution.
|
boolean |
isValid()
Check that all of the dependent's dependencies are valid.
|
void |
makeInvalid(int action,
LanguageConnectionContext lcc)
Mark the dependent as invalid (due to at least one of
its dependencies being invalid).
|
void |
markUnused()
Mark the activation as unused.
|
ConstantAction |
popConstantAction()
Pop the ConstantAction stack, returning the element which was just popped
off the stack.
|
void |
prepareToInvalidate(Provider p,
int action,
LanguageConnectionContext lcc)
Prepare to mark the dependent as invalid (due to at least one of
its dependencies being invalid).
|
ConstantAction |
pushConstantAction(ConstantAction newConstantAction)
Push a ConstantAction to be returned by getConstantAction().
|
void |
reset()
Resets the activation to the "pre-execution" state -
that is, the state where it can be used to begin a new execution.
|
void |
setAutoGeneratedKeysResultsetInfo(int[] columnIndexes,
java.lang.String[] columnNames)
Set the auto-generated keys resultset mode to true for this activation.
|
void |
setCurrentRow(ExecRow currentRow,
int resultSetNumber)
Generated plans have a current row field for ease in defining
the methods and finding them dynamically.
|
void |
setCursorName(java.lang.String cursorName)
JDBC requires that all select statements be converted into cursors,
and that the cursor name be settable for each execution of a select
statement.
|
void |
setDDLTableDescriptor(TableDescriptor td)
Save the TableDescriptor for the target of
DDL so that it can be passed between the
various ConstantActions during execution.
|
void |
setForCreateTable()
Mark the Activation as being for create table.
|
void |
setForUpdateIndexScan(CursorResultSet forUpdateResultSet)
beetle 3865: updateable cursor using index.
|
void |
setHeapConglomerateController(ConglomerateController updateHeapCC)
Set the ConglomerateController to be used for an update or delete.
|
void |
setIndexConglomerateNumber(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.)
|
void |
setIndexScanController(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.)
|
void |
setMaxRows(long maxRows)
Set the maximum # of rows. (# of rows that can
be returned by a ResultSet. 0 means no limit.)
|
void |
setParameters(ParameterValueSet parameterValues,
DataTypeDescriptor[] parameterTypes)
Sets the parameter values for this execution of the statement.
|
void |
setParentActivation(Activation a)
This activation is created in a dynamic call context or a substatement
execution context, chain its parent statements activation..
|
void |
setParentResultSet(TemporaryRowHolder rs,
java.lang.String resultSetId) |
void |
setResultSetHoldability(boolean resultSetHoldability)
Set current resultset holdability.
|
void |
setSingleExecution()
Set the activation for a single execution.
|
void |
setTargetVTI(java.sql.ResultSet targetVTI)
Save the ResultSet for the target
of an update/delete to a VTI.
|
SQLSessionContext |
setupSQLSessionContextForChildren(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).
|
public BaseActivation ac
ExecPreparedStatement ps
GeneratedClass gc
DataTypeDescriptor[] paramTypes
private final LanguageConnectionContext lcc
GenericActivationHolder(LanguageConnectionContext lcc, GeneratedClass gc, ExecPreparedStatement ps, boolean scrollable) throws StandardException
gc
- The GeneratedClass of the Activationps
- The PreparedStatement this ActivationHolder is associated
withStandardException
- Thrown on errorpublic void reset() throws StandardException
Activation
reset
in interface Activation
StandardException
- thrown on failureActivation.reset()
public boolean checkIfThisActivationHasHoldCursor(java.lang.String tableName)
checkIfThisActivationHasHoldCursor
in interface Activation
public void setCursorName(java.lang.String cursorName)
Activation
There will be a JSQL statement to disable the "cursorization" of all select statements. For non-cursorized select statements, this method will have no effect.
This has no effect if the activation has been closed.
setCursorName
in interface Activation
cursorName
- The cursor name to use.Activation.setCursorName(java.lang.String)
public java.lang.String getCursorName()
Activation
Statements that do not support cursors will return a null.
getCursorName
in interface Activation
Activation.getCursorName()
public void setResultSetHoldability(boolean resultSetHoldability)
Activation
setResultSetHoldability
in interface Activation
resultSetHoldability
- The new resultset holdability.Activation.setResultSetHoldability(boolean)
public boolean getResultSetHoldability()
Activation
getResultSetHoldability
in interface Activation
Activation.getResultSetHoldability()
public void setAutoGeneratedKeysResultsetInfo(int[] columnIndexes, java.lang.String[] columnNames)
Activation
setAutoGeneratedKeysResultsetInfo
in interface Activation
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 positionActivation.setAutoGeneratedKeysResultsetInfo(int[], java.lang.String[])
public boolean getAutoGeneratedKeysResultsetMode()
Activation
getAutoGeneratedKeysResultsetMode
in interface Activation
Activation.getAutoGeneratedKeysResultsetMode()
public int[] getAutoGeneratedKeysColumnIndexes()
Activation
getAutoGeneratedKeysColumnIndexes
in interface Activation
Activation.getAutoGeneratedKeysColumnIndexes()
public java.lang.String[] getAutoGeneratedKeysColumnNames()
Activation
getAutoGeneratedKeysColumnNames
in interface Activation
Activation.getAutoGeneratedKeysColumnNames()
public LanguageConnectionContext getLanguageConnectionContext()
Activation
getLanguageConnectionContext
in interface Activation
Activation.getLanguageConnectionContext()
public TransactionController getTransactionController()
Activation
getTransactionController
in interface Activation
public ExecutionFactory getExecutionFactory()
Activation
getExecutionFactory
in interface Activation
Activation.getExecutionFactory()
public ParameterValueSet getParameterValueSet()
Activation
getParameterValueSet
in interface Activation
Activation.getParameterValueSet()
public void setParameters(ParameterValueSet parameterValues, DataTypeDescriptor[] parameterTypes) throws StandardException
Activation
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.
setParameters
in interface Activation
parameterValues
- The values of the parameters.StandardException
Activation.setParameters(org.apache.derby.iapi.sql.ParameterValueSet, org.apache.derby.iapi.types.DataTypeDescriptor[])
public ResultSet execute() throws StandardException
Activation
execute
in interface Activation
StandardException
- Thrown on failureActivation.execute()
public ResultSet getResultSet()
Activation
getResultSet
in interface Activation
Activation.getResultSet()
public void setCurrentRow(ExecRow currentRow, int resultSetNumber)
Activation
When all processing on the currentRow has been completed, callers should call activation.clearCurrentRow(resultSetNumber) to ensure that no unnecessary references are retained to rows. This will allow the rows no longer in use to be collected by the garbage collecter.
setCurrentRow
in interface Activation
currentRow
- The row to be operated upon.resultSetNumber
- The resultSetNumber for the current ResultSetActivation.setCurrentRow(org.apache.derby.iapi.sql.execute.ExecRow, int)
public Row getCurrentRow(int resultSetNumber)
Activation
getCurrentRow
in interface Activation
Activation.getCurrentRow(int)
public void clearCurrentRow(int resultSetNumber)
Activation
When all processing on the currentRow has been completed, callers should call activation.clearCurrentRow(resultSetNumber) to ensure that no unnecessary references are retained to rows. This will allow the rows no longer in use to be collected by the garbage collecter.
clearCurrentRow
in interface Activation
resultSetNumber
- The resultSetNumber for the current ResultSetActivation.clearCurrentRow(int)
public ExecPreparedStatement getPreparedStatement()
Activation
getPreparedStatement
in interface Activation
Activation.getPreparedStatement()
public void checkStatementValidity() throws StandardException
Activation
checkStatementValidity
in interface Activation
StandardException
public ResultDescription getResultDescription()
Activation
getResultDescription
in interface Activation
Activation.getResultDescription()
public DataValueFactory getDataValueFactory()
Activation
getDataValueFactory
in interface Activation
Activation.getDataValueFactory()
public RowLocation getRowLocationTemplate(int itemNumber)
Activation
getRowLocationTemplate
in interface Activation
itemNumber
- The saved item number.Activation.getRowLocationTemplate(int)
public ConglomerateController getHeapConglomerateController()
Activation
getHeapConglomerateController
in interface Activation
Activation.getHeapConglomerateController()
public void setHeapConglomerateController(ConglomerateController updateHeapCC)
Activation
setHeapConglomerateController
in interface Activation
updateHeapCC
- The ConglomerateController to reuse for the update or delete.Activation.setHeapConglomerateController(org.apache.derby.iapi.store.access.ConglomerateController)
public void clearHeapConglomerateController()
Activation
clearHeapConglomerateController
in interface Activation
Activation.clearHeapConglomerateController()
public ScanController getIndexScanController()
Activation
getIndexScanController
in interface Activation
Activation.getIndexScanController()
public void setIndexScanController(ScanController indexSC)
Activation
setIndexScanController
in interface Activation
indexSC
- The ScanController to reuse for the update or delete.Activation.setIndexScanController(org.apache.derby.iapi.store.access.ScanController)
public long getIndexConglomerateNumber()
Activation
getIndexConglomerateNumber
in interface Activation
Activation.getIndexConglomerateNumber()
public void setIndexConglomerateNumber(long indexConglomerateNumber)
Activation
setIndexConglomerateNumber
in interface Activation
indexConglomerateNumber
- The conglomerate number of the index to reuse for the update or delete.Activation.setIndexConglomerateNumber(long)
public void clearIndexScanInfo()
Activation
clearIndexScanInfo
in interface Activation
Activation.clearIndexScanInfo()
public void close() throws StandardException
Activation
Any class that implements this must be prepared to be executed from garbage collection, ie. there is no matching context stack.
close
in interface Activation
StandardException
- Thrown on errorActivation.close()
public boolean isClosed()
Activation
isClosed
in interface Activation
Activation.isClosed()
public void setSingleExecution()
setSingleExecution
in interface Activation
Activation.setSingleExecution()
public boolean isSingleExecution()
isSingleExecution
in interface Activation
Activation.isSingleExecution()
public int getNumSubqueries()
getNumSubqueries
in interface Activation
public void setForCreateTable()
Activation
setForCreateTable
in interface Activation
Activation.setForCreateTable()
public boolean getForCreateTable()
Activation
getForCreateTable
in interface Activation
Activation.getForCreateTable()
public void setDDLTableDescriptor(TableDescriptor td)
Activation
setDDLTableDescriptor
in interface Activation
Activation.setDDLTableDescriptor(org.apache.derby.iapi.sql.dictionary.TableDescriptor)
public TableDescriptor getDDLTableDescriptor()
Activation
getDDLTableDescriptor
in interface Activation
Activation.getDDLTableDescriptor()
public void setMaxRows(long maxRows)
Activation
setMaxRows
in interface Activation
maxRows
- Maximum # of rows. (0 means no limit.)Activation.setMaxRows(long)
public long getMaxRows()
Activation
getMaxRows
in interface Activation
Activation.getMaxRows()
public void setTargetVTI(java.sql.ResultSet targetVTI)
Activation
setTargetVTI
in interface Activation
public java.sql.ResultSet getTargetVTI()
Activation
getTargetVTI
in interface Activation
public SQLSessionContext getSQLSessionContextForChildren()
Activation
getSQLSessionContextForChildren
in interface Activation
public SQLSessionContext setupSQLSessionContextForChildren(boolean push)
Activation
setupSQLSessionContextForChildren
in interface Activation
push
- true if used to push a new connection contextpublic void setParentActivation(Activation a)
Activation
setParentActivation
in interface Activation
public Activation getParentActivation()
Activation
getParentActivation
in interface Activation
public DependableFinder getDependableFinder()
Dependable
getDependableFinder
in interface Dependable
Dependable.getDependableFinder()
public java.lang.String getObjectName()
Dependable
getObjectName
in interface Dependable
Dependable.getObjectName()
public UUID getObjectID()
Dependable
getObjectID
in interface Dependable
Dependable.getObjectID()
public java.lang.String getClassType()
Dependable
getClassType
in interface Dependable
Dependable.getClassType()
public boolean isPersistent()
Dependable
isPersistent
in interface Dependable
Dependable.isPersistent()
public boolean isValid()
Dependent
isValid
in interface Dependent
Dependent.isValid()
public void makeInvalid(int action, LanguageConnectionContext lcc) throws StandardException
Dependent
makeInvalid
in interface Dependent
action
- The action causing the invalidationlcc
- The LanguageConnectionContextStandardException
- thrown if unable to make it invalidDependent.makeInvalid(int, org.apache.derby.iapi.sql.conn.LanguageConnectionContext)
public void prepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc) throws StandardException
Dependent
prepareToInvalidate
in interface Dependent
p
- the provideraction
- The action causing the invalidationlcc
- The LanguageConnectionContextStandardException
- thrown if unable to make it invalidDependent.prepareToInvalidate(org.apache.derby.iapi.sql.depend.Provider, int, org.apache.derby.iapi.sql.conn.LanguageConnectionContext)
public void markUnused()
markUnused
in interface Activation
public boolean isInUse()
isInUse
in interface Activation
public void addWarning(java.sql.SQLWarning w)
Activation
addWarning
in interface Activation
Activation.addWarning(java.sql.SQLWarning)
public java.sql.SQLWarning getWarnings()
Activation
getWarnings
in interface Activation
Activation.getWarnings()
public void clearWarnings()
Activation
clearWarnings
in interface Activation
Activation.clearWarnings()
public void informOfRowCount(NoPutResultSet resultSet, long rowCount) throws StandardException
Activation
informOfRowCount
in interface Activation
StandardException
- Thrown on errorActivation.informOfRowCount(org.apache.derby.iapi.sql.execute.NoPutResultSet, long)
public boolean isCursorActivation()
Activation
isCursorActivation
in interface Activation
Activation.isCursorActivation()
public ConstantAction pushConstantAction(ConstantAction newConstantAction)
Activation
pushConstantAction
in interface Activation
public ConstantAction popConstantAction()
Activation
popConstantAction
in interface Activation
public ConstantAction getConstantAction()
Activation
getConstantAction
in interface Activation
public void setParentResultSet(TemporaryRowHolder rs, java.lang.String resultSetId)
setParentResultSet
in interface Activation
public java.util.Vector<TemporaryRowHolder> getParentResultSet(java.lang.String resultSetId)
Activation
getParentResultSet
in interface Activation
public void clearParentResultSets()
clearParentResultSets
in interface Activation
public java.util.Enumeration<java.lang.String> getParentResultSetKeys()
getParentResultSetKeys
in interface Activation
public void setForUpdateIndexScan(CursorResultSet forUpdateResultSet)
Activation
setForUpdateIndexScan
in interface Activation
public CursorResultSet getForUpdateIndexScan()
getForUpdateIndexScan
in interface Activation
public java.sql.ResultSet[][] getDynamicResults()
Activation
getDynamicResults
in interface Activation
public int getMaxDynamicResults()
Activation
getMaxDynamicResults
in interface Activation
public NumberDataValue getCurrentValueAndAdvance(java.lang.String sequenceUUIDstring, int typeFormatID) throws StandardException
Activation
getCurrentValueAndAdvance
in interface Activation
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.StandardException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.