class EmbedConnectionContext extends ContextImpl implements ConnectionContext
| Modifier and Type | Field and Description |
|---|---|
private java.lang.ref.SoftReference |
connRef
We hold a soft reference to the connection so that when the application
releases its reference to the Connection without closing it, its finalize
method will be called, which will then close the connection.
|
CONTEXT_ID| Constructor and Description |
|---|
EmbedConnectionContext(ContextManager cm,
EmbedConnection conn) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
java.sql.Connection |
getNestedConnection(boolean internal)
Get a connection equivalent to the call
DriverManager.getConnection("jdbc:default:connection");
|
java.sql.ResultSet |
getResultSet(ResultSet executionResultSet)
Get a jdbc ResultSet based on the execution ResultSet.
|
boolean |
processInaccessibleDynamicResult(java.sql.ResultSet resultSet)
Process a ResultSet from a procedure to be a dynamic result,
but one that will be closed due to it being inaccessible.
|
appendErrorInfo, getContextManager, getIdName, isLastHandler, popMe, pushMeprivate java.lang.ref.SoftReference connRef
EmbedConnectionContext(ContextManager cm, EmbedConnection conn)
public void cleanupOnError(java.lang.Throwable error)
ContextContexts 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).
cleanupOnError in interface Contextpublic java.sql.Connection getNestedConnection(boolean internal)
throws java.sql.SQLException
DriverManager.getConnection("jdbc:default:connection");
getNestedConnection in interface ConnectionContextjava.sql.SQLException - Parent connection has been closed.public java.sql.ResultSet getResultSet(ResultSet executionResultSet) throws java.sql.SQLException
getResultSet in interface ConnectionContextexecutionResultSet - a result set as gotten from executionjava.sql.SQLException - on errorpublic boolean processInaccessibleDynamicResult(java.sql.ResultSet resultSet)
processInaccessibleDynamicResult in interface ConnectionContextresultSet - ResultSet to process.EmbedStatement.processDynamicResult(EmbedConnection, java.sql.ResultSet, EmbedStatement)Apache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.