public class ConnectionConnectionPool extends JDBCConnectionPool
java.sql.Connection
objects.
The use of this pool is responsible for making sure that close is not called
on the java.sql.Connection
unless it is explicitly desired.
Clients are expected to create a proxy for the
java.sql.Connection
borrowed from this pool and to return the
borrowed java.sql.Connection
back into the pool after the JDBC
application has closed the connection proxy.m_connectionInitializationCallback
borrowedAccumulator, borrowedConnectionsCount, borrowedSamples, core, DEFAULT_ABANDONED_CONNECTION_TIMEOUT, DEFAULT_CONNECTION_HARVEST_MAX_COUNT, DEFAULT_CONNECTION_HARVEST_TRIGGER_COUNT, DEFAULT_CONNECTION_WAIT_TIMEOUT, DEFAULT_INACTIVE_CONNECTION_TIMEOUT, DEFAULT_INITIAL_POOL_SIZE, DEFAULT_MAX_CONNECTIONS_PER_SERVICE, DEFAULT_MAX_CONNECTIONS_PER_SHARD, DEFAULT_MAX_POOL_SIZE, DEFAULT_MIN_POOL_SIZE, DEFAULT_POOLNAME_PREFIX, DEFAULT_QUERY_TIMEOUT, DEFAULT_SECONDS_TO_TRUST_IDLE_CONNECTION, DEFAULT_TIME_TO_LIVE_CONNECTION_TIMEOUT, DEFAULT_TIMEOUT_CHECK_INTERVAL, DEFAULT_VALIDATE_BORROWED_CONNECTION, logWriter, m_connectionAffinityCallback, m_connectionLabelingCallback, m_lifeCycleState, THREAD_POOL_SIZE, totalConnectionsCount
Constructor and Description |
---|
ConnectionConnectionPool(JDBCConnectionFactoryAdapter connectionFactoryAdapter)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
closeConnection(Connection connection)
Closes the
java.sql.Connection . |
Connection |
getConnection(JDBCConnectionRetrievalInfo connectionRetrievalInfo)
Gets a
java.sql.Connection from the connection pool. |
boolean |
returnConnection(Connection connection)
Returns a
java.sql.Connection back into the connection pool. |
borrowConnection, getConnectionInitializationCallback, getConnectionObjectForLabelingConfigure, getMaxStatements, getSQLForValidateConnection, registerConnectionInitializationCallback, setConnectionFactory, setMaxStatements, setSQLForValidateConnection, unregisterConnectionInitializationCallback
closeConnection, closePhysicalConnection, closePooledConnection, closeUsedPhysicalConnection, computeBorrowGiveUpTimestamp, createOnePooledConnection, createOnePooledConnection, discardUsedConnection, getAvailableConnection, getStatistics, getUsedConnection, incrementCumulativeConnectionsCreated, isAffinityStrict, isStillOkayToBorrow, needToConfigureConnection, purge, recycle, refresh, returnConnection, returnUsedPhysicalConnection, setConnectionHarvestable, setNoWaitBorrow
getAbandonedConnectionsCount, getAbandonedConnectionTimeout, getAbandonedConnectionTimer, getAvailableConnectionsCount, getAverageBorrowedConnectionsCount, getBorrowedConnectionsCount, getConnectionAffinityCallback, getConnectionFactoryAdapter, getConnectionHarvestMaxCount, getConnectionHarvestTriggerCount, getConnectionLabelingCallback, getConnectionLabelingHighCost, getConnectionRepurposeThreshold, getConnectionRetrievalInfo, getConnectionWaitTimeout, getCumulativeConnectionBorrowedCount, getCumulativeConnectionReturnedCount, getCumulativeConnectionsCreated, getCumulativeConnectionUseTime, getCumulativeFailedConnectionWaitCount, getCumulativeFailedConnectionWaitTime, getCumulativeReturnedConnectionCount, getCumulativeSuccessfulConnectionWaitCount, getCumulativeSuccessfulConnectionWaitTime, getDatabaseTopologyInfo, getFailoverEventHandlerTask, getFailoverInfo, getHighCostConnectionReuseThreshold, getInactiveConnectionTimeout, getInactiveConnectionTimer, getInitialPoolSize, getLifeCycleState, getLoginTimeout, getLogWriter, getMaxConnectionReuseCount, getMaxConnectionReuseTime, getMaxConnectionsPerService, getMaxConnectionsPerShard, getMaxPoolSize, getMinPoolSize, getName, getONSConfiguration, getPeakConnectionsCount, getPeakConnectionWaitTime, getPendingRequestsCount, getQueryTimeout, getSecondsToTrustIdleConnection, getServiceName, getShardedDatabaseInfo, getShardRoutingCacheInfo, getTimeoutCheckInterval, getTimeToLiveConnectionTimeout, getTimeToLiveConnectionTimer, getTotalConnectionsCount, getValidateConnectionOnBorrow, handleFailoverEvent, ilogFine, ilogFinest, ilogThrowing, incrementConnectionsClosedCount, incrementConnectionsCreatedCount, isFailoverEnabled, isFailoverExplicitlySet, isLifecycleFailed, isLifecycleRunning, isLifecycleStarting, isLifecycleStopped, isLifecycleStopping, isRuntimeLoadBalancingEnabled, isShareable, reconfigure, registerConnectionAffinityCallback, registerConnectionLabelingCallback, removeConnectionAffinityCallback, removeConnectionLabelingCallback, resetAllPoolStatistics, resetNonCumulativePoolStatistics, setAbandonedConnectionTimeout, setConnectionHarvestMaxCount, setConnectionHarvestTriggerCount, setConnectionLabelingHighCost, setConnectionRepurposeThreshold, setConnectionRetrievalInfo, setConnectionWaitTimeout, setFailoverEnabled, setFailoverInfo, setHighCostConnectionReuseThreshold, setInactiveConnectionTimeout, setInitialPoolSize, setLoginTimeout, setLogWriter, setMaxConnectionReuseCount, setMaxConnectionReuseTime, setMaxConnectionsPerService, setMaxConnectionsPerShard, setMaxPoolSize, setMinPoolSize, setName, setONSConfiguration, setQueryTimeout, setRuntimeLoadBalancingEnabled, setSecondsToTrustIdleConnection, setShareable, setTimeoutCheckInterval, setTimeToLiveConnectionTimeout, setValidateConnectionOnBorrow, start, stop, validatePoolSizes
public ConnectionConnectionPool(JDBCConnectionFactoryAdapter connectionFactoryAdapter) throws UniversalConnectionPoolException
connectionFactoryAdapter
- The connection factory adapter.UniversalConnectionPoolException
- If an error occurs constructing this.public Connection getConnection(JDBCConnectionRetrievalInfo connectionRetrievalInfo) throws UniversalConnectionPoolException
java.sql.Connection
from the connection pool.
This is a physical connection, not a proxy.connectionRetrievalInfo
- Info to use to get the
java.sql.Connection
.java.sql.Connection
.UniversalConnectionPoolException
- if an error occurs getting a java.sql.Connection
.NoAvailableConnectionsException
- if all of the connections are in use.public boolean returnConnection(Connection connection) throws UniversalConnectionPoolException
java.sql.Connection
back into the connection pool.connection
- The java.sql.Connection to return back into
the pool.
true
if the java.sql.Connection
is in
use and was returned to the pool. false otherwise.
UniversalConnectionPoolException
- if an error occurs when
returning the java.sql.Connection
.public boolean closeConnection(Connection connection) throws UniversalConnectionPoolException
java.sql.Connection
. Do not put it back into
the pool.connection
- The java.sql.Connection
to close.true
if the java.sql.Connection
is in
use and was closed; false
otherwise.UniversalConnectionPoolException
- if an error occurs closing the java.sql.Connection
.
Copyright © 2008, 2017, Oracle. All rights reserved.