ConnectionContext
, Context
class EmbedConnectionContext extends ContextImpl implements ConnectionContext
Modifier and Type | Field | Description |
---|---|---|
private java.lang.ref.SoftReference<EmbedConnection> |
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 | Description |
---|---|
EmbedConnectionContext(ContextManager cm,
EmbedConnection conn) |
Modifier and Type | Method | 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
|
java.sql.ResultSet |
getResultSet(ResultSet executionResultSet) |
Get a jdbc ResultSet based on the execution ResultSet.
|
private LanguageConnectionContext |
privilegedGetLCC(EmbedConnection conn) |
Private, privileged lookup of the lcc..
|
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, pushMe
private java.lang.ref.SoftReference<EmbedConnection> connRef
EmbedConnectionContext(ContextManager cm, EmbedConnection conn)
public void cleanupOnError(java.lang.Throwable error)
Context
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).
cleanupOnError
in interface Context
public java.sql.Connection getNestedConnection(boolean internal) throws java.sql.SQLException
DriverManager.getConnection("jdbc:default:connection");
getNestedConnection
in interface ConnectionContext
java.sql.SQLException
- Parent connection has been closed.public java.sql.ResultSet getResultSet(ResultSet executionResultSet) throws java.sql.SQLException
getResultSet
in interface ConnectionContext
executionResultSet
- a result set as gotten from executionjava.sql.SQLException
- on errorpublic boolean processInaccessibleDynamicResult(java.sql.ResultSet resultSet)
processInaccessibleDynamicResult
in interface ConnectionContext
resultSet
- ResultSet to process.EmbedStatement.processDynamicResult(EmbedConnection, java.sql.ResultSet, EmbedStatement)
private LanguageConnectionContext privilegedGetLCC(EmbedConnection conn)
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.