|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.iapi.services.context.ContextImpl
org.apache.derby.impl.sql.conn.GenericStatementContext
GenericStatementContext is pushed/popped around a statement prepare and execute so that any statement specific clean up can be performed.
Field Summary | |
private java.util.ArrayList |
dependencies
|
private java.lang.String |
internalSavePointName
|
private boolean |
inUse
|
private boolean |
isAtomic
|
private boolean |
isSystemCode
|
private LanguageConnectionContext |
lcc
|
private NoPutResultSet[] |
materializedSubqueries
|
private boolean |
parentInTrigger
|
private ParameterValueSet |
pvs
|
private boolean |
rollbackParentContext
|
private boolean |
setSavePoint
|
private short |
sqlAllowed
Set to one of RoutineAliasInfo. |
private java.lang.String |
stmtText
|
private NoPutResultSet[] |
subqueryTrackingArray
|
private TransactionController |
tc
|
private ResultSet |
topResultSet
|
Fields inherited from class org.apache.derby.iapi.services.context.ContextImpl |
|
Constructor Summary | |
(package private) |
GenericStatementContext(LanguageConnectionContext lcc,
TransactionController tc)
|
Method Summary | |
void |
addDependency(Dependency dy)
Track a Dependency within this StatementContext. |
java.lang.StringBuffer |
appendErrorInfo()
|
void |
cleanupOnError(java.lang.Throwable error)
Close down the top ResultSet, if relevant, and rollback to the internal savepoint, if one was set. |
void |
clearInUse()
Mark this context as not in use. |
void |
clearSavePoint()
Clear the save point for the current statement. |
short |
getSQLAllowed()
Get the setting of the SQL allowed state. |
java.lang.String |
getStatementText()
Return the text of the current statement. |
NoPutResultSet[] |
getSubqueryTrackingArray()
Get the subquery tracking array for this query. |
boolean |
getSystemCode()
Return true if this statement is system code. |
boolean |
inTrigger()
Returns whether we started from within the context of a trigger or not. |
boolean |
inUse()
Is this statement context in use or not. |
boolean |
isAtomic()
Indicates whether the statement needs to be executed atomically or not, i.e., whether a commit/rollback is permitted by a connection nested in this statement. |
boolean |
isLastHandler(int severity)
Return whether or not this context is the "last" handler for a the specified severity level. |
boolean |
onStack()
Reports whether this StatementContext is on the context stack. |
private void |
pleaseBeOnStack()
Raise an exception if this Context is not in use, that is, on the Context Stack. |
void |
resetSavePoint()
Resets the savepoint to the current spot if it is set, otherwise, noop. |
void |
setInUse(boolean parentInTrigger,
boolean isAtomic,
java.lang.String stmtText,
ParameterValueSet pvs)
Mark this context as being in use. |
void |
setParentRollback()
Indicate that, in the event of a statement-level exception, this context is NOT the last one that needs to be rolled back--rather, it is nested within some other statement context, and that other context needs to be rolled back, too. |
void |
setSavePoint()
Set a save point for the current statement. |
void |
setSQLAllowed(short allow,
boolean force)
Set the level of SQL allowed in this and subsequent nested statements due to a routine call. |
void |
setSubqueryResultSet(int subqueryNumber,
NoPutResultSet subqueryResultSet,
int numSubqueries)
Set the appropriate entry in the subquery tracking array for the specified subquery. |
void |
setSystemCode()
Set to indicate statement is system code. |
void |
setTopResultSet(ResultSet topResultSet,
NoPutResultSet[] subqueryTrackingArray)
Set the top ResultSet in the ResultSet tree for close down on an error. |
private void |
stuffTopResultSet(ResultSet topResultSet,
NoPutResultSet[] subqueryTrackingArray)
Private minion of setTopResultSet() and clearInUse() |
Methods inherited from class org.apache.derby.iapi.services.context.ContextImpl |
getContextManager, getIdName, popMe, pushMe |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.derby.iapi.services.context.Context |
getContextManager, getIdName, popMe, pushMe |
Field Detail |
private final TransactionController tc
private boolean setSavePoint
private java.lang.String internalSavePointName
private ResultSet topResultSet
private java.util.ArrayList dependencies
private NoPutResultSet[] subqueryTrackingArray
private NoPutResultSet[] materializedSubqueries
private final LanguageConnectionContext lcc
private boolean inUse
private boolean parentInTrigger
private boolean isAtomic
private boolean isSystemCode
private boolean rollbackParentContext
private java.lang.String stmtText
private ParameterValueSet pvs
private short sqlAllowed
Constructor Detail |
GenericStatementContext(LanguageConnectionContext lcc, TransactionController tc)
Method Detail |
public void setInUse(boolean parentInTrigger, boolean isAtomic, java.lang.String stmtText, ParameterValueSet pvs)
StatementContext
setInUse
in interface StatementContext
isAtomic
- true if the statement must be executed
atomicallystmtText
- the text of the statement. Needed for any language
statement (currently, for any statement that can cause a trigger
to fire). Please set this unless you are some funky jdbc setXXX
method or something.pvs
- parameter value set, if it has onepublic void clearInUse()
StatementContext
clearInUse
in interface StatementContext
public void setSavePoint() throws StandardException
StatementContext
setSavePoint
in interface StatementContext
StandardException
- Thrown on errorStatementContext.setSavePoint()
public void resetSavePoint() throws StandardException
resetSavePoint
in interface StatementContext
StandardException
- Thrown on errorStatementContext.resetSavePoint()
public void clearSavePoint() throws StandardException
StatementContext
clearSavePoint
in interface StatementContext
StandardException
- Thrown on errorStatementContext.clearSavePoint()
public void setTopResultSet(ResultSet topResultSet, NoPutResultSet[] subqueryTrackingArray) throws StandardException
setTopResultSet
in interface StatementContext
topResultSet
- The top ResultSet in the ResultSet treesubqueryTrackingArray
- (Sparse) of tops of subquery ResultSet trees
StandardException
- thrown on error.private void stuffTopResultSet(ResultSet topResultSet, NoPutResultSet[] subqueryTrackingArray)
topResultSet
- make this the top result setsubqueryTrackingArray
- where to keep track of subqueries in this statement
public void setSubqueryResultSet(int subqueryNumber, NoPutResultSet subqueryResultSet, int numSubqueries) throws StandardException
setSubqueryResultSet
in interface StatementContext
subqueryNumber
- The subquery # for this subquerysubqueryResultSet
- The ResultSet at the top of the subquerynumSubqueries
- The total # of subqueries in the entire query
StandardException
- thrown on error.public NoPutResultSet[] getSubqueryTrackingArray() throws StandardException
getSubqueryTrackingArray
in interface StatementContext
StandardException
- thrown on error.public void addDependency(Dependency dy) throws StandardException
addDependency
in interface StatementContext
dy
- The dependency to track.
StandardException
- thrown on error.public boolean inTrigger()
inTrigger
in interface StatementContext
public void cleanupOnError(java.lang.Throwable error) throws StandardException
cleanupOnError
in interface Context
StandardException
- thrown on error. REVISIT: don't want
cleanupOnError's to throw exceptions.public boolean isLastHandler(int severity)
Context
isLastHandler
in interface Context
isLastHandler
in class ContextImpl
Context.isLastHandler(int)
public boolean onStack()
onStack
in interface StatementContext
public boolean isAtomic()
isAtomic
in interface StatementContext
public java.lang.String getStatementText()
getStatementText
in interface StatementContext
private void pleaseBeOnStack() throws StandardException
StandardException
- thrown on error.public boolean inUse()
StatementContext
inUse
in interface StatementContext
public void setSQLAllowed(short allow, boolean force)
StatementContext
setSQLAllowed
in interface StatementContext
force
- set to true to override more restrictive setting. Used to
reset the permissions after a function call.public short getSQLAllowed()
StatementContext
getSQLAllowed
in interface StatementContext
public void setParentRollback()
setParentRollback
in interface StatementContext
public void setSystemCode()
setSystemCode
in interface StatementContext
public boolean getSystemCode()
getSystemCode
in interface StatementContext
public java.lang.StringBuffer appendErrorInfo()
appendErrorInfo
in class ContextImpl
|
Built on Mon 2007-06-04 09:58:47+0400, from revision ??? | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |