Top Fields Constructors Methods
com.mchange.v2.c3p0.impl

public final Class NewPooledConnection

extends AbstractC3P0PooledConnection
Class Inheritance
Imports
java.util.*, java.sql.*, javax.sql.*, com.mchange.v2.c3p0.*, com.mchange.v2.c3p0.stmt.*, com.mchange.v2.c3p0.util.*, com.mchange.v2.log.*, java.lang.reflect.Method, com.mchange.v2.lang.ObjectUtils, com.mchange.v2.sql.SqlUtils

Field Summary

Modifier and TypeField and Description
pack-priv final boolean
pack-priv volatile boolean
pack-priv final ConnectionEventSupport
pack-priv boolean
pack-priv int
pack-priv final int
pack-priv final ConnectionTester
pack-priv final String
pack-priv final int
pack-priv final boolean
pack-priv final int
pack-priv final Map<K, V>
pack-priv volatile NewProxyConnection
pack-priv final boolean
pack-priv volatile boolean
pack-priv static Set<E>
pack-priv Throwable
pack-priv volatile boolean
private static final MLogger
pack-priv Set<E>
private static final SQLException
pack-priv final Connection
pack-priv final String
pack-priv Set<E>
pack-priv volatile boolean
pack-priv Map<K, V>
pack-priv GooGooStatementCache
pack-priv final StatementEventSupport
pack-priv final boolean
pack-priv final boolean
pack-priv final boolean
pack-priv volatile boolean
pack-priv Set<E>
Inherited from com.mchange.v2.c3p0.impl.AbstractC3P0PooledConnection:
inInternalUseLock

Constructor Summary

AccessConstructor and Description
public
NewPooledConnection(Connection con, ConnectionTester connectionTester, int connectionIsValidTimeout, boolean autoCommitOnClose, boolean forceIgnoreUnresolvedTransactions, String preferredTestQuery, ConnectionCustomizer cc, String pdsIdt)

Method Summary

Modifier and TypeMethod and Description
public void
addConnectionEventListener(ConnectionEventListener
a component, usually the connection pool manager, that has implemented the ConnectionEventListener interface and wants to be notified when the connection is closed or has an error
cel
)

Implements javax.sql.PooledConnection.addConnectionEventListener.

Registers the given event listener so that it will be notified when an event occurs on this PooledConnection object.

public void
addStatementEventListener(StatementEventListener
an component which implements the StatementEventListener interface that is to be registered with this PooledConnection object
sel
)

Implements javax.sql.PooledConnection.addStatementEventListener.

Registers a StatementEventListener with this PooledConnection object.

private static int
private static boolean
private static Map<K, V>
private void
checkinAllCachedStatements(List<E> closeExceptions)

pack-priv synchronized void
pack-priv synchronized Object
checkoutStatement(Method stmtProducingMethod, Object[] args)

private void
cleanupAllStatementResultSets(List<E> closeExceptions)

private void
cleanupResultSets(List<E> closeExceptions)

private void
private void
cleanupUncachedStatements(List<E> closeExceptions)

private void
cleanupUnclosedResultSetsSet(Set<E> rsSet, List<E> closeExceptions)

public synchronized void
close()

Implements javax.sql.PooledConnection.close, com.mchange.v1.util.ClosableResource.close.

Closes the physical connection that this PooledConnection object represents.

private void
private void
close(Throwable cause, boolean forced)

public synchronized void
private void
pack-priv synchronized void
private void
private void
public synchronized Connection
getConnection()

Implements javax.sql.PooledConnection.getConnection.

Creates and returns a Connection object that is a handle for the physical connection that this PooledConnection object represents.

public synchronized int
pack-priv Connection
public synchronized GooGooStatementCache
pack-priv SQLException
private static String
public synchronized void
pack-priv synchronized boolean
private static void
logCloseExceptions(Throwable cause, Collection<E> exceptions)

pack-priv synchronized void
pack-priv synchronized void
pack-priv synchronized void
pack-priv synchronized void
pack-priv void
markClosedProxyConnection(NewProxyConnection npc, boolean txn_known_resolved)

pack-priv synchronized void
pack-priv synchronized void
pack-priv synchronized void
pack-priv synchronized void
pack-priv void
pack-priv void
markNewHoldability(int holdability)

pack-priv void
markNewReadOnly(boolean readOnly)

pack-priv void
pack-priv void
markNewTypeMap(Map<K, V> typeMap)

public void
public void
public void
removeConnectionEventListener(ConnectionEventListener
a component, usually the connection pool manager, that has implemented the ConnectionEventListener interface and been registered with this PooledConnection object as a listener
cel
)

Implements javax.sql.PooledConnection.removeConnectionEventListener.

Removes the given event listener from the list of components that will be notified when an event occurs on this PooledConnection object.

public void
removeStatementEventListener(StatementEventListener
the component which implements the StatementEventListener interface that was previously registered with this PooledConnection object
sel
)

Implements javax.sql.PooledConnection.removeStatementEventListener.

Removes the specified StatementEventListener from the list of components that will be notified when the driver detects that a PreparedStatement has been closed or is invalid.

private void
reset(boolean txn_known_resolved)

private Set<E>
resultSets(Statement stmt, boolean create)

private void

Field Detail

autoCommitOnCloseback to summary
pack-priv final boolean autoCommitOnClose
catalog_nondefaultback to summary
pack-priv volatile boolean catalog_nondefault
cesback to summary
pack-priv final ConnectionEventSupport ces
connection_error_signaledback to summary
pack-priv boolean connection_error_signaled
connection_statusback to summary
pack-priv int connection_status
connectionIsValidTimeoutback to summary
pack-priv final int connectionIsValidTimeout
connectionTesterback to summary
pack-priv final ConnectionTester connectionTester
dflt_catalogback to summary
pack-priv final String dflt_catalog
dflt_holdabilityback to summary
pack-priv final int dflt_holdability
dflt_readOnlyback to summary
pack-priv final boolean dflt_readOnly
dflt_txn_isolationback to summary
pack-priv final int dflt_txn_isolation
dflt_typeMapback to summary
pack-priv final Map<K, V> dflt_typeMap
exposedProxyback to summary
pack-priv volatile NewProxyConnection exposedProxy
forceIgnoreUnresolvedTransactionsback to summary
pack-priv final boolean forceIgnoreUnresolvedTransactions
holdability_nondefaultback to summary
pack-priv volatile boolean holdability_nondefault
holdabilityBugKeysback to summary
pack-priv static Set<E> holdabilityBugKeys
invalidatingExceptionback to summary
pack-priv Throwable invalidatingException
isolation_lvl_nondefaultback to summary
pack-priv volatile boolean isolation_lvl_nondefault
loggerback to summary
private static final MLogger logger
metaDataResultSetsback to summary
pack-priv Set<E> metaDataResultSets
NORMAL_CLOSE_PLACEHOLDERback to summary
private static final SQLException NORMAL_CLOSE_PLACEHOLDER
physicalConnectionback to summary
pack-priv final Connection physicalConnection
preferredTestQueryback to summary
pack-priv final String preferredTestQuery
rawConnectionResultSetsback to summary
pack-priv Set<E> rawConnectionResultSets
readOnly_nondefaultback to summary
pack-priv volatile boolean readOnly_nondefault
resultSetsForStatementsback to summary
pack-priv Map<K, V> resultSetsForStatements
scacheback to summary
pack-priv GooGooStatementCache scache
sesback to summary
pack-priv final StatementEventSupport ses
supports_setHoldabilityback to summary
pack-priv final boolean supports_setHoldability
supports_setReadOnlyback to summary
pack-priv final boolean supports_setReadOnly
supports_setTypeMapback to summary
pack-priv final boolean supports_setTypeMap
typeMap_nondefaultback to summary
pack-priv volatile boolean typeMap_nondefault
uncachedActiveStatementsback to summary
pack-priv Set<E> uncachedActiveStatements

Constructor Detail

NewPooledConnectionback to summary
public NewPooledConnection(Connection con, ConnectionTester connectionTester, int connectionIsValidTimeout, boolean autoCommitOnClose, boolean forceIgnoreUnresolvedTransactions, String preferredTestQuery, ConnectionCustomizer cc, String pdsIdt) throws SQLException

Method Detail

addConnectionEventListenerback to summary
public void addConnectionEventListener(ConnectionEventListener cel)

Implements javax.sql.PooledConnection.addConnectionEventListener.

Doc from javax.sql.PooledConnection.addConnectionEventListener.

Registers the given event listener so that it will be notified when an event occurs on this PooledConnection object.

Parameters
cel:ConnectionEventListener

a component, usually the connection pool manager, that has implemented the ConnectionEventListener interface and wants to be notified when the connection is closed or has an error

addStatementEventListenerback to summary
public void addStatementEventListener(StatementEventListener sel)

Implements javax.sql.PooledConnection.addStatementEventListener.

Doc from javax.sql.PooledConnection.addStatementEventListener.

Registers a StatementEventListener with this PooledConnection object. Components that wish to be notified when PreparedStatements created by the connection are closed or are detected to be invalid may use this method to register a StatementEventListener with this PooledConnection object.

Parameters
sel:StatementEventListener

an component which implements the StatementEventListener interface that is to be registered with this PooledConnection object

carefulCheckHoldabilityback to summary
private static int carefulCheckHoldability(Connection con)
carefulCheckReadOnlyback to summary
private static boolean carefulCheckReadOnly(Connection con)
carefulCheckTypeMapback to summary
private static Map<K, V> carefulCheckTypeMap(Connection con)
checkinAllCachedStatementsback to summary
private void checkinAllCachedStatements(List<E> closeExceptions)
checkinStatementback to summary
pack-priv synchronized void checkinStatement(Statement stmt) throws SQLException
checkoutStatementback to summary
pack-priv synchronized Object checkoutStatement(Method stmtProducingMethod, Object[] args) throws SQLException
cleanupAllStatementResultSetsback to summary
private void cleanupAllStatementResultSets(List<E> closeExceptions)
cleanupResultSetsback to summary
private void cleanupResultSets(List<E> closeExceptions)
cleanupStatementResultSetsback to summary
private void cleanupStatementResultSets(Statement stmt)
cleanupUncachedStatementsback to summary
private void cleanupUncachedStatements(List<E> closeExceptions)
cleanupUnclosedResultSetsSetback to summary
private void cleanupUnclosedResultSetsSet(Set<E> rsSet, List<E> closeExceptions)
closeback to summary
public synchronized void close() throws SQLException

Implements javax.sql.PooledConnection.close, com.mchange.v1.util.ClosableResource.close.

Doc from javax.sql.PooledConnection.close.

Closes the physical connection that this PooledConnection object represents. An application never calls this method directly; it is called by the connection pool module, or manager.

See the interface description for more information.

Exceptions
SQLException:
if a database access error occurs
closeback to summary
private void close(Throwable cause) throws SQLException
closeback to summary
private void close(Throwable cause, boolean forced) throws SQLException
closeAllback to summary
public synchronized void closeAll() throws SQLException
closeAllCachedStatementsback to summary
private void closeAllCachedStatements() throws SQLException
closeMaybeCheckedOutback to summary
pack-priv synchronized void closeMaybeCheckedOut(boolean checked_out) throws SQLException

Implements abstract com.mchange.v2.c3p0.impl.AbstractC3P0PooledConnection.closeMaybeCheckedOut.

fireConnectionClosedback to summary
private void fireConnectionClosed()
fireConnectionErrorOccurredback to summary
private void fireConnectionErrorOccurred(SQLException error)
getConnectionback to summary
public synchronized Connection getConnection() throws SQLException

Implements javax.sql.PooledConnection.getConnection.

Doc from javax.sql.PooledConnection.getConnection.

Creates and returns a Connection object that is a handle for the physical connection that this PooledConnection object represents. The connection pool manager calls this method when an application has called the method DataSource.getConnection and there are no PooledConnection objects available. See the interface description for more information.

Returns:Connection

a Connection object that is a handle to this PooledConnection object

Exceptions
SQLException:
if a database access error occurs
getConnectionStatusback to summary
public synchronized int getConnectionStatus()
getPhysicalConnectionback to summary
pack-priv Connection getPhysicalConnection()

Implements abstract com.mchange.v2.c3p0.impl.AbstractC3P0PooledConnection.getPhysicalConnection.

getStatementCacheback to summary
public synchronized GooGooStatementCache getStatementCache()
handleThrowableback to summary
pack-priv SQLException handleThrowable(Throwable t)
holdabilityBugKeyback to summary
private static String holdabilityBugKey(Connection con, Error err)
initStatementCacheback to summary
public synchronized void initStatementCache(GooGooStatementCache scache)

Implements abstract com.mchange.v2.c3p0.impl.AbstractC3P0PooledConnection.initStatementCache.

isStatementCachingback to summary
pack-priv synchronized boolean isStatementCaching()
logCloseExceptionsback to summary
private static void logCloseExceptions(Throwable cause, Collection<E> exceptions)
markActiveMetaDataResultSetback to summary
pack-priv synchronized void markActiveMetaDataResultSet(ResultSet rs)
markActiveRawConnectionResultSetback to summary
pack-priv synchronized void markActiveRawConnectionResultSet(ResultSet rs)
markActiveResultSetForStatementback to summary
pack-priv synchronized void markActiveResultSetForStatement(Statement stmt, ResultSet rs)
markActiveUncachedStatementback to summary
pack-priv synchronized void markActiveUncachedStatement(Statement stmt)
markClosedProxyConnectionback to summary
pack-priv void markClosedProxyConnection(NewProxyConnection npc, boolean txn_known_resolved)
markInactiveMetaDataResultSetback to summary
pack-priv synchronized void markInactiveMetaDataResultSet(ResultSet rs)
markInactiveRawConnectionResultSetback to summary
pack-priv synchronized void markInactiveRawConnectionResultSet(ResultSet rs)
markInactiveResultSetForStatementback to summary
pack-priv synchronized void markInactiveResultSetForStatement(Statement stmt, ResultSet rs)
markInactiveUncachedStatementback to summary
pack-priv synchronized void markInactiveUncachedStatement(Statement stmt)
markNewCatalogback to summary
pack-priv void markNewCatalog(String catalog)
markNewHoldabilityback to summary
pack-priv void markNewHoldability(int holdability)
markNewReadOnlyback to summary
pack-priv void markNewReadOnly(boolean readOnly)
markNewTxnIsolationback to summary
pack-priv void markNewTxnIsolation(int lvl)
markNewTypeMapback to summary
pack-priv void markNewTypeMap(Map<K, V> typeMap)
printConnectionListenersback to summary
public void printConnectionListeners()
printStatementListenersback to summary
public void printStatementListeners()
removeConnectionEventListenerback to summary
public void removeConnectionEventListener(ConnectionEventListener cel)

Implements javax.sql.PooledConnection.removeConnectionEventListener.

Doc from javax.sql.PooledConnection.removeConnectionEventListener.

Removes the given event listener from the list of components that will be notified when an event occurs on this PooledConnection object.

Parameters
cel:ConnectionEventListener

a component, usually the connection pool manager, that has implemented the ConnectionEventListener interface and been registered with this PooledConnection object as a listener

removeStatementEventListenerback to summary
public void removeStatementEventListener(StatementEventListener sel)

Implements javax.sql.PooledConnection.removeStatementEventListener.

Doc from javax.sql.PooledConnection.removeStatementEventListener.

Removes the specified StatementEventListener from the list of components that will be notified when the driver detects that a PreparedStatement has been closed or is invalid.

Parameters
sel:StatementEventListener

the component which implements the StatementEventListener interface that was previously registered with this PooledConnection object

resetback to summary
private void reset(boolean txn_known_resolved) throws SQLException
resultSetsback to summary
private Set<E> resultSets(Statement stmt, boolean create)
updateConnectionStatusback to summary
private void updateConnectionStatus(int status)