org.apache.derby.impl.sql.execute
Class GenericExecutionContext

java.lang.Object
  extended by org.apache.derby.iapi.services.context.ContextImpl
      extended by org.apache.derby.impl.sql.execute.GenericExecutionContext
All Implemented Interfaces:
Context, ExecutionContext

 class GenericExecutionContext
extends ContextImpl
implements ExecutionContext

ExecutionContext stores the result set factory to be used by the current connection, and manages execution-level connection activities.

An execution context is expected to be on the stack for the duration of the connection.


Field Summary
private  ExecutionFactory execFactory
           
 
Fields inherited from interface org.apache.derby.iapi.sql.execute.ExecutionContext
CONTEXT_ID, CS_TO_JDBC_ISOLATION_LEVEL_MAP, CS_TO_SQL_ISOLATION_MAP, READ_COMMITTED_ISOLATION_LEVEL, READ_UNCOMMITTED_ISOLATION_LEVEL, REPEATABLE_READ_ISOLATION_LEVEL, SERIALIZABLE_ISOLATION_LEVEL, UNSPECIFIED_ISOLATION_LEVEL
 
Constructor Summary
GenericExecutionContext(ContextManager cm, ExecutionFactory ef)
           
 
Method Summary
 void cleanupOnError(java.lang.Throwable error)
          Contexts will be passed errors that are caught by the outer system when they are serious enough to require corrective action.
 ExecutionFactory getExecutionFactory()
          Get the ExecutionFactory from this ExecutionContext.
 
Methods inherited from class org.apache.derby.iapi.services.context.ContextImpl
appendErrorInfo, getContextManager, getIdName, isLastHandler, 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, isLastHandler, popMe, pushMe
 

Field Detail

execFactory

private ExecutionFactory execFactory
Constructor Detail

GenericExecutionContext

GenericExecutionContext(ContextManager cm,
                        ExecutionFactory ef)
Method Detail

getExecutionFactory

public ExecutionFactory getExecutionFactory()
Description copied from interface: ExecutionContext
Get the ExecutionFactory from this ExecutionContext.

Specified by:
getExecutionFactory in interface ExecutionContext
Returns:
The Execution factory associated with this ExecutionContext

cleanupOnError

public void cleanupOnError(java.lang.Throwable error)
                    throws StandardException
Description copied from interface: Context
Contexts will be passed errors that are caught by the outer system when they are serious enough to require corrective action. They will be told what the error is, so that they can react appropriately. Most of the time, the contexts will react by either doing nothing or by removing themselves from the context manager. If there are no other references to the context, removing itself from the manager equates to freeing it.
On an exception that is session severity or greater the Context must push itself off the stack. This is to ensure that after a session has been closed there are no Contexts on the stack that potentially hold references to objects, thus delaying their garbage collection.

Contexts must release all their resources before removing themselves from their context manager.

The context manager will "unwind" the contexts during cleanup in the reverse order they were placed on its global stack.

If error is an instance of StandardException then an implementation of this method may throw a new exception if and only if the new exception is an instance of StandardException that is more severe than the original error or the new exception is a not an instance of StandardException (e.g java.lang.NullPointerException).

Specified by:
cleanupOnError in interface Context
Throws:
StandardException - Thrown on error

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.