public interface UniversalConnectionPool extends Diagnosable
There are several key objects that make up the connection pool:
Physical Pool The physical pool maintains pooled connections that can be borrowed from the pool, returned to the pool, or closed and not returned to the pool. The pool keeps track of the connections that are available (so that they can be borrowed) and connections that are in use (so they can be reaped if it is determined that they are no longer valid).
Connection Factory Adapter The connection pool must rely on
another entity to create and close connections because connection pools can pool
any type of connection. This is the responsibility of the connection
factory adapter. A connection factory adapter is tied to a specific
resource (JDBC, JCA, LDAP, and so forth). When the connection pool needs to
create a new connection, it asks the connection factory adapter to
do so. The returned connection is placed inside a
UniversalPooledConnection object that is then placed into
the connection pool. When the connection pool closes a connection, it
hands the connection to the connection factory adapter which then closes
the connection.
Pooled Connections Each pooled connection in the connection pool is
an instance of UniversalPooledConnection. The pooled connection
decorates a physical connection (created by the connection factory adapter) which
can be borrowed.
Connection Retrieval Info The connection retrieval info object is
used by the connection factory adapter to create connections. It contains
resource-specific information that the connection factory adapter uses
to create connections. For example, the JDBC connection retrieval
info object maintains the user and password that are used to create a
connection from a JDBC resource. The JCA connection retrieval info
object maintains the Subject and JCA
ConnectionRequestInfo object.
Pool Properties The pool provides some properties for users to customize the pool's behavior, such as:
Statistics The pool maintains some statistics such as:
Lifecycle A connection pool has a lifecycle. See
UniversalConnectionPoolLifeCycleState for details.
A connection pool is started by calling the start() method and
stopped by calling the stop() method. Connections may not be
borrowed until the connection pool has been started or after the pool has
been stopped (unless the pool has been started again).
| Modifier and Type | Method and Description |
|---|---|
UniversalPooledConnection |
borrowConnection(ConnectionRetrievalInfo connectionRetrievalInfo)
Gets a connection from the connection pool.
|
default java.util.concurrent.CompletionStage<UniversalPooledConnection> |
borrowConnectionAsync(ConnectionRetrievalInfo cri,
java.util.concurrent.Executor executor)
Get a connection from a pool asynchronously
|
void |
closeConnection(UniversalPooledConnection pooledConnection)
Closes the pooled connection.
|
default int |
getAbandonedConnectionTimeout()
Gets the abandoned connection timeout value.
|
int |
getAvailableConnectionsCount()
Gets the number of connections that are available in the connection
pool (that is, connections in the pool that are not currently in use by
clients).
|
int |
getBorrowedConnectionsCount()
Gets the number of connections that are actively in use by clients.
|
default int |
getConnectionHarvestMaxCount()
Gets the maximum number of connections that may be harvested when
the connection harvesting occurs.
|
default int |
getConnectionHarvestTriggerCount()
Gets the number of available connections below which the connection
pool's connection harvesting occurs.
|
default int |
getConnectionLabelingHighCost()
Obtains the cost value which identifies a connection as "high-cost"
for connection labeling.
|
default int |
getConnectionRepurposeThreshold()
Gets the connection repurpose threshold for the pool.
|
ConnectionRetrievalInfo |
getConnectionRetrievalInfo()
Gets the
ConnectionRetrievalInfo object which contains
user and password information to create the connections. |
default int |
getConnectionValidationTimeout()
Connection validation timeout getter
This property changes the allowed time for a connection validation.
|
default java.time.Duration |
getConnectionWaitDuration()
Gets the maximum time (in java.time.Duration) that any connection borrow request
can wait before it returns to the application.
|
default java.lang.Long |
getConnectionWaitDurationInMillis()
Get connection wait duration in milliseconds.
|
default int |
getConnectionWaitTimeout()
Deprecated.
|
default java.lang.Long |
getConnectionWaitTimeoutWhileServiceDown()
Get connection wait timeout that applies while service is down in seconds.
|
default boolean |
getFailFastOnChunkUnavailable()
Return the boolean value of the property fail fast on chunk unavailable.
|
default int |
getHighCostConnectionReuseThreshold()
Obtains the high-cost connection reuse threshold property
value for connection labeling.
|
default int |
getInactiveConnectionTimeout()
Gets the inactive connection timeout value.
|
default int |
getInitialPoolSize()
Gets the initial pool size.
|
UniversalConnectionPoolLifeCycleState |
getLifeCycleState()
Gets the life cycle state of the connection pool.
|
default int |
getLoginTimeout()
Gets the default maximum time in seconds that a driver will wait while attempting
to connect to a database once the driver has been identified.
|
default int |
getMaxConnectionReuseCount()
Gets the maximum connection reuse count property value.
|
default long |
getMaxConnectionReuseTime()
Gets the maximum connection reuse time property value.
|
default int |
getMaxConnectionsPerService()
Gets the maximum number of connections that can be obtained to a particular
service, in a shared pool.
|
default int |
getMaxIdle()
Gets the maximum number of idle connections that the connection pool
maintains.
|
default int |
getMaxPoolSize()
Gets the maximum number of connections that the connection pool
maintains.
|
default int |
getMinIdle()
Gets the minimum number of idle connections that the connection pool
maintains.
|
default int |
getMinPoolSize()
Gets the minimum number of connections that the connection pool
maintains.
|
java.lang.String |
getName()
Gets the name of the connection pool.
|
oracle.ucp.config.PoolProperties |
getPoolProperties()
Pool properties backbone getter.
|
default java.lang.Object |
getPoolProperty(oracle.ucp.config.PoolProperty poolProperty)
Get a pool property.
|
default int |
getQueryTimeout()
Gets the number of seconds the driver will wait for a Statement object to execute to the given number of seconds.
|
default int |
getSecondsToTrustIdleConnection()
Gets the seconds To Trust Idle Connection value which determines whether
or not connection validation on borrow should be skipped
See property description in
setSecondsToTrustIdleConnection(). |
default boolean |
getShardingMode()
Returns the mode of UCP when UCP is using a Sharded Database.
|
UniversalConnectionPoolStatistics |
getStatistics()
Gets the statistics of the connection pool.
|
default int |
getTimeoutCheckInterval()
Gets the frequency (in seconds) to enforce the timeout properties.
|
default int |
getTimeToLiveConnectionTimeout()
Gets the maximum time (in seconds) a connection may remain in-use.
|
java.lang.String |
getUCPEventListenerProvider()
Gets the UCP event listener provider name.
|
default boolean |
getValidateConnectionOnBorrow()
Returns whether or not a connection being borrowed should first be
validated.
|
default boolean |
isCommitOnConnectionReturn()
Returns the boolean value for the property that controls the behavior of UCP
when a connection is released back to
the pool with pending uncommitted changes in an active transaction.
|
default boolean |
isCreateConnectionInBorrowThread()
Get flag defining how to create connections on pool grow.
|
default boolean |
isReadOnlyInstanceAllowed()
Returns true if the connection borrow is allowed to a read-only instance,
false otherwise.
|
default boolean |
isShareable()
Returns whether the pool is shareable or not.
|
void |
purge()
Removes all connections from the connection pool.
|
void |
reconfigure(java.util.Properties props)
Allows a connection pool to be reconfigured gracefully with a
different set of properties that specify the behavior of the
connection pool at runtime.
|
void |
recycle()
Allows only invalid available connections
in the pool to be replaced with new/fresh connections.
|
void |
refresh()
Allows connections in the pool, both borrowed and available ones,
to be replaced with new/fresh connections.
|
default void |
registerConnectionAffinityCallback(ConnectionAffinityCallback cbk)
Registers a
ConnectionAffinityCallback objet on the
connection pool. |
default void |
registerConnectionLabelingCallback(ConnectionLabelingCallback cbk)
Registers a
ConnectionLabelingCallback object with this
connection pool. |
default void |
removeConnectionAffinityCallback()
Removes the
ConnectionAffinityCallback object registered on
the connection pool. |
default void |
removeConnectionLabelingCallback()
Removes the
ConnectionLabelingCallback object registered
with this connection pool, if any. |
void |
returnConnection(UniversalPooledConnection pooledConnection)
Returns a connection back into the connection pool.
|
default void |
setAbandonedConnectionTimeout(int abandonedConnectionTimeout)
Sets the abandoned connection timeout.
|
default void |
setCommitOnConnectionReturn(boolean commit)
Sets the boolean value for the property that controls the behavior of UCP
when a connection is released back to
the pool with pending uncommitted changes in an active transaction.
|
default void |
setConnectionHarvestMaxCount(int connectionHarvestMaxCount)
Sets the maximum number of connections that may be harvested when
the connection harvesting occurs.
|
default void |
setConnectionHarvestTriggerCount(int connectionHarvestTriggerCount)
Sets the number of available connections below which the connection
pool's connection harvesting occurs.
|
default void |
setConnectionLabelingHighCost(int highCost)
Sets the cost value which identifies a connection as "high-cost" for
connection labeling.
|
default void |
setConnectionRepurposeThreshold(java.lang.Integer threshold)
Sets the connection repurpose threshold for the pool.
|
void |
setConnectionRetrievalInfo(ConnectionRetrievalInfo cri)
Sets the
ConnectionRetrievalInfo for creating the initial
connections (physical connections) in the pool based on the
initialPoolSize property. |
default void |
setConnectionValidationTimeout(int connectionValidationTimeout)
Connection validation timeout setter
This property changes the allowed time for a connection validation.
|
default void |
setConnectionWaitDuration(java.time.Duration waitDuration)
Configures how much time a connection request call may wait before it either
successfully returns a connection or throws an exception.
|
default void |
setConnectionWaitDurationInMillis(java.lang.Long durationInMillis)
Set connection wait duration in milliseconds.
|
default void |
setConnectionWaitTimeout(int waitTimeout)
Deprecated.
|
default void |
setConnectionWaitTimeoutWhileServiceDown(java.lang.Long timeoutServiceDown)
Set connection wait timeout that applies while service is down.
|
default void |
setCreateConnectionInBorrowThread(boolean createConnectionInBorrowThread)
Set flag defining how to create connections on pool grow.
|
default void |
setFailFastOnChunkUnavailable(boolean failFastEnabled)
This flag determines if connection requests to unavailable chunks will fail fast
or not.
|
default void |
setHighCostConnectionReuseThreshold(int threshold)
Sets the high-cost connection reuse threshold for connection labeling.
|
default void |
setInactiveConnectionTimeout(int inactiveConnectionTimeout)
Sets the inactive connection timeout.
|
default void |
setInitialPoolSize(int initialPoolSize)
Sets the initial pool size.
|
default void |
setLoginTimeout(int seconds)
Sets the default maximum time in seconds that a driver will wait while attempting
to connect to a database once the driver has been identified.
|
default void |
setMaxConnectionReuseCount(int maxConnectionReuseCount)
Sets the maximum connection reuse count property.
|
default void |
setMaxConnectionReuseTime(long maxConnectionReuseTime)
Sets the maximum connection reuse time property.
|
default void |
setMaxConnectionsPerService(int maxConnectionsPerService)
Sets the maximum number of connections that can be obtained to a particular
service, in a shared pool.
|
default void |
setMaxIdle(int maxIdle)
Sets the maximum number of idle connections.
|
default void |
setMaxPoolSize(int maxPoolSize)
Sets the maximum number of connections.
|
default void |
setMinIdle(int minIdle)
Sets the minimum number of idle connections.
|
default void |
setMinPoolSize(int minPoolSize)
Sets the minimum number of connections.
|
void |
setName(java.lang.String name)
Sets the name of the connection pool.
|
default void |
setPoolProperty(oracle.ucp.config.PoolProperty poolProperty,
java.lang.Object value,
int code)
Set a given pool property.
|
default void |
setQueryTimeout(int queryTimeout)
Sets the number of seconds the driver will wait for a Statement object to execute to the given number of seconds.
|
default void |
setReadOnlyInstanceAllowed(boolean readOnlyInstanceAllowed)
Sets the read-only instance allowed value on the datasource.
|
default void |
setSecondsToTrustIdleConnection(int secondsToTrustIdleConnection)
Sets the time in seconds to trust an idle connection to skip a validation
test.
|
default void |
setShardingMode(boolean shardingMode)
This API changes the mode of UCP when UCP is using a Sharded Database.
|
default void |
setTimeoutCheckInterval(int timeoutCheckInterval)
Sets the frequency (in seconds) to enforce the timeout properties.
|
default void |
setTimeToLiveConnectionTimeout(int timeToLiveConnectionTimeout)
Sets the maximum time (in seconds) a connection may remain in-use.
|
void |
setUCPEventListenerProvider(java.lang.String providerName)
Sets the UCP event listener provider by name.
|
default void |
setValidateConnectionOnBorrow(boolean validateConnectionOnBorrow)
Makes the pool validate the connection before returning it to the user by
calling the JDBC API "isValid".
|
default void |
start()
if keepMetadataConn is not specified, assume it is "false".
|
void |
start(ConnectionRetrievalInfo connectionRetrievalInfo,
boolean keepMetadataConn)
Starts the connection pool.
|
void |
stop()
Stops the connection pool.
|
beginCurrentSql, debug, debug, endCurrentSql, format, getDiagnosable, isLoggingLevelFinest, resumeLogging, secure, suspendLogging, trace, traceUniversalPooledConnection borrowConnection(ConnectionRetrievalInfo connectionRetrievalInfo) throws UniversalConnectionPoolException
connectionRetrievalInfo - Info to use to get the connection.UniversalConnectionPoolException - if an error occurs getting a
connection.NoAvailableConnectionsException - if all of the connections are
in use.default java.util.concurrent.CompletionStage<UniversalPooledConnection> borrowConnectionAsync(ConnectionRetrievalInfo cri, java.util.concurrent.Executor executor) throws java.lang.UnsupportedOperationException
cri - Info to use to get the connection.executor - executor for asychronous processingjava.lang.UnsupportedOperationExceptionvoid returnConnection(UniversalPooledConnection pooledConnection) throws UniversalConnectionPoolException
pooledConnection - The connection to return back into the pool.UniversalConnectionPoolException - in case it is not possible to return connection.void closeConnection(UniversalPooledConnection pooledConnection) throws UniversalConnectionPoolException
pooledConnection - The pooled connection to close.UniversalConnectionPoolException - if an error occurs closing the
connection.void refresh()
throws UniversalConnectionPoolException
UniversalConnectionPoolException - in case it was not possible to refresh.void recycle()
throws UniversalConnectionPoolException
UniversalConnectionPoolException - in case it was not possible to recycle.void purge()
throws UniversalConnectionPoolException
refresh()
is that the connection pool is left empty with no connections available
after calling purge(). Some of the connection pool
properties such as minPoolSize or
initialPoolSize may not be honored when purging connections
from the pool.
Note that both borrowed and available connections are removed when this API is called. Any borrowed connections incur an exception after this API is called. The user is expected to retry and obtain a new connection from the pool.
UniversalConnectionPoolException - in case it was not possible to purge.void reconfigure(java.util.Properties props)
throws UniversalConnectionPoolException
props - Containing new set of pool properties for reconfiguration.UniversalConnectionPoolException - in case it wat not possible to reconfigure.void start(ConnectionRetrievalInfo connectionRetrievalInfo, boolean keepMetadataConn) throws UniversalConnectionPoolException
connectionRetrievalInfo - retrieval info with data for creation metadata connection.keepMetadataConn - keep metadata connection in the working set even if init pool size is 0
(because the next operation will be "borrow").UniversalConnectionPoolException - If an error occurs during
start.default void start()
throws UniversalConnectionPoolException
UniversalConnectionPoolExceptionvoid stop() throws UniversalConnectionPoolException
UniversalConnectionPoolException - in case it was not possible to stop.java.lang.String getName()
void setName(java.lang.String name)
name - The name of the connection pool.default int getInitialPoolSize()
default void setInitialPoolSize(int initialPoolSize)
throws UniversalConnectionPoolException
initialPoolSize - the initial pool size.UniversalConnectionPoolException - in case it was not
possible to set initial pool size.default int getMinPoolSize()
default void setMinPoolSize(int minPoolSize)
throws UniversalConnectionPoolException
minPoolSize - The minimum number of connections.UniversalConnectionPoolException - in case it was not
possible to set min pool size.default int getMinIdle()
default void setMinIdle(int minIdle)
throws UniversalConnectionPoolException
minIdle - The minimum number of idle connections.UniversalConnectionPoolException - in case it was not
possible to set min idle.default int getMaxIdle()
default void setMaxIdle(int maxIdle)
throws UniversalConnectionPoolException
Integer.MAX_VALUE.maxIdle - The maximum number of idle connections.UniversalConnectionPoolException - in case it was not
possible to set max idle.default int getMaxPoolSize()
default void setMaxPoolSize(int maxPoolSize)
throws UniversalConnectionPoolException
maxPoolSize - The maximum number of connections.UniversalConnectionPoolException - in case it was not
possible to set max pool size.default int getInactiveConnectionTimeout()
default void setInactiveConnectionTimeout(int inactiveConnectionTimeout)
throws UniversalConnectionPoolException
This property's behaviour is affected by the system property oracle.ucp.timersAffectAllConnections.
For more details go to -
PoolDataSource.SYSTEM_PROPERTY_TIMERS_AFFECT_ALL_CONNECTIONS.
inactiveConnectionTimeout - The inactive connection timeout
(in seconds).UniversalConnectionPoolException - in case it was not
possible to set timeout.default int getAbandonedConnectionTimeout()
default void setAbandonedConnectionTimeout(int abandonedConnectionTimeout)
throws UniversalConnectionPoolException
abandonedConnectionTimeout - The value of how long a connection
has not been used before it is
abandoned (in seconds).UniversalConnectionPoolException - in case it was not
possible to set timeout.@Deprecated default int getConnectionWaitTimeout()
This method is deprecated.
Use getConnectionWaitDuration() instead.
setConnectionWaitTimeoutdefault java.time.Duration getConnectionWaitDuration()
Gets the maximum time (in java.time.Duration) that any connection borrow request can wait before it returns to the application.
setConnectionWaitDuration@Deprecated
default void setConnectionWaitTimeout(int waitTimeout)
throws UniversalConnectionPoolException
Configures how much time a connection request call may wait before it either successfully returns a connection or throws an exception.
The wait timeout starts from the point when a connection borrow request is submitted to the pool.
During this time, UCP may either return a connection that's currently available in the pool (ideal scenario) or create a new connection if the pool hasn't reached its maximum size. Otherwise, UCP waits for a connection to be returned to the pool.
By default, the connection wait timeout is set to 3 seconds.
Setting the timeout to 0 makes UCP throw an exception immediately if there is no connection available and no room to grow the pool. Note that it still allows UCP to create a new connection if the maximum size hasn't been reached, and that may take some time.
This method is deprecated.
Use setConnectionWaitDuration(java.time.Duration) instead.
waitTimeout - The amount of time for a connection request to wait.UniversalConnectionPoolException - in case it was not
possible to set timeout.default void setConnectionWaitDuration(java.time.Duration waitDuration)
throws UniversalConnectionPoolException
Configures how much time a connection request call may wait before it either successfully returns a connection or throws an exception.
The wait duration starts from the point when a connection borrow request is submitted to the pool.
During this time, UCP may either return a connection that's currently available in the pool (ideal scenario) or create a new connection if the pool hasn't reached its maximum size. Otherwise, UCP waits for a connection to be returned to the pool.
By default, the connection wait timeout is set to 3 seconds.
Setting the connection wait timeout to
Duration.ZERO makes UCP throw an exception immediately if there is no
connection available and no room to grow the pool. Note that it still allows UCP
to create a new connection if the maximum size hasn't been reached, and that may
take some time.
waitDuration - The duration for a connection request to wait.UniversalConnectionPoolException - in case it was not possible to set timeout.default java.lang.Long getConnectionWaitDurationInMillis()
default void setConnectionWaitDurationInMillis(java.lang.Long durationInMillis)
throws UniversalConnectionPoolException
durationInMillis - long value of duration in milliseconds.UniversalConnectionPoolException - if not able to set for some reason.default java.lang.Long getConnectionWaitTimeoutWhileServiceDown()
default void setConnectionWaitTimeoutWhileServiceDown(java.lang.Long timeoutServiceDown)
throws UniversalConnectionPoolException
timeoutServiceDown - value of timeout while service is down in seconds.UniversalConnectionPoolException - if not able to set for some reason.default boolean getFailFastOnChunkUnavailable()
The default value is true.
default void setFailFastOnChunkUnavailable(boolean failFastEnabled)
throws UniversalConnectionPoolException
failFastEnabled - true if this property is to be set to enabled, false otherwise.UniversalConnectionPoolExceptiondefault int getTimeToLiveConnectionTimeout()
default void setTimeToLiveConnectionTimeout(int timeToLiveConnectionTimeout)
throws UniversalConnectionPoolException
timeToLiveConnectionTimeout - The maximum time (in seconds) a
used connection may be active.UniversalConnectionPoolException - in case it was not
possible to set timeout.default int getTimeoutCheckInterval()
abandonedConnectionTimeout,
inactiveConnectionTimeout, and
timeToLiveConnectionTimeout.default void setTimeoutCheckInterval(int timeoutCheckInterval)
throws UniversalConnectionPoolException
timeoutCheckInterval - The frequency (in seconds) to enforce
the timeout properties.UniversalConnectionPoolException - in case it was not
possible to set timeout.default boolean getValidateConnectionOnBorrow()
true, connection validity
is performed before returning the connection to the user.default void setValidateConnectionOnBorrow(boolean validateConnectionOnBorrow)
Makes the pool validate the connection before returning it to the user by calling the JDBC API "isValid".
Validating the connection each time it's borrowed from the pool has a performance cost because it typically requires a full roundtrip to the database. You can tune how the Oracle JDBC thin driver validates connections using the "oracle.jdbc.defaultConnectionValidation" property (please refer to the JDBC driver javadoc). You may also configure "secondsToTrustIdleConnection" to avoid validating connections that are often active.
Please note that by default, OracleConnection.ConnectionValidation
isn't enabled, but UCP performs the lightweight INBAND_DOWN validation to know if a
connection needs to be drained.
validateConnectionOnBorrow - Whether or not a connection
being borrowed should first be
validated.setSecondsToTrustIdleConnectiondefault int getConnectionHarvestTriggerCount()
default void setConnectionHarvestTriggerCount(int connectionHarvestTriggerCount)
throws UniversalConnectionPoolException
connectionHarvestTriggerCount - The number of available
connections below which the
connection pool's connection
harvesting occurs.UniversalConnectionPoolException - in case it was not
possible to set count.default int getConnectionHarvestMaxCount()
connectionHarvestMaxCount.default void setConnectionHarvestMaxCount(int connectionHarvestMaxCount)
throws UniversalConnectionPoolException
connectionHarvestMaxCount - the maximum number of connections
that may be harvested when the
connection harvesting occurs.UniversalConnectionPoolException - in case it was not
possible to set timeout.int getAvailableConnectionsCount()
int getBorrowedConnectionsCount()
UniversalConnectionPoolStatistics getStatistics()
UniversalConnectionPoolLifeCycleState getLifeCycleState()
ConnectionRetrievalInfo getConnectionRetrievalInfo()
ConnectionRetrievalInfo object which contains
user and password information to create the connections.ConnectionRetrievalInfo object which contains user and
password information to create the connections.void setConnectionRetrievalInfo(ConnectionRetrievalInfo cri)
ConnectionRetrievalInfo for creating the initial
connections (physical connections) in the pool based on the
initialPoolSize property.cri - The ConnectionRetrievalInfo with user and
password for creating the initial connections in the pool.default void registerConnectionAffinityCallback(ConnectionAffinityCallback cbk) throws UniversalConnectionPoolException
ConnectionAffinityCallback objet on the
connection pool.cbk - The affinity callback object to be registeredUniversalConnectionPoolException - If callback registration fails.default void removeConnectionAffinityCallback()
throws UniversalConnectionPoolException
ConnectionAffinityCallback object registered on
the connection pool.UniversalConnectionPoolException - If callback removal fails.default void registerConnectionLabelingCallback(ConnectionLabelingCallback cbk) throws UniversalConnectionPoolException
ConnectionLabelingCallback object with this
connection pool.cbk - The ConnectionLabelingCallback object to be
registered.UniversalConnectionPoolException - If there is a callback already
registered with this pool.default void removeConnectionLabelingCallback()
throws UniversalConnectionPoolException
ConnectionLabelingCallback object registered
with this connection pool, if any.UniversalConnectionPoolException - If callback removal fails.default long getMaxConnectionReuseTime()
setMaxConnectionReuseTime().default void setMaxConnectionReuseTime(long maxConnectionReuseTime)
throws UniversalConnectionPoolException
This property's behaviour is affected by the system property oracle.ucp.timersAffectAllConnections.
For more details go to -
PoolDataSource.SYSTEM_PROPERTY_TIMERS_AFFECT_ALL_CONNECTIONS.
maxConnectionReuseTime - Maximum connection reuse time (in seconds).UniversalConnectionPoolException - in case it was not
possible to set timeout.default int getMaxConnectionReuseCount()
setMaxConnectionReuseCount().default void setMaxConnectionReuseCount(int maxConnectionReuseCount)
throws UniversalConnectionPoolException
maxConnectionReuseCount - Maximum connection reuse count.UniversalConnectionPoolException - in case it was not
possible to set count.default int getSecondsToTrustIdleConnection()
setSecondsToTrustIdleConnection().default void setSecondsToTrustIdleConnection(int secondsToTrustIdleConnection)
throws UniversalConnectionPoolException
setValidateConnectionOnBorrow(boolean). When set to any
positive value, a connection validation during the checkout is skipped if
the connection was successfully used and returned to the pool within the
time specified for secondsToTrustIdleConnection.
Default value is set to 0 seconds which means that the feature is disabled.
With this mode enabled, UCP will do a SOCKET validation on every connection borrow and default driver validation type (can be changed with the "oracle.jdbc.defaultConnectionValidation" system property) after designated seconds to trust idle connection has passed
secondsToTrustIdleConnection - The value of how long a connection can be trusted to skip
connectionValidationOnBorrowUniversalConnectionPoolException - in case setter was failed.default int getConnectionLabelingHighCost()
setConnectionLabelingHighCostdefault void setConnectionLabelingHighCost(int highCost)
throws UniversalConnectionPoolException
cost(Properties, Properties)
method in ConnectionLabelingCallback to find a connection in the pool for a
request. When this property is set, connections with a cost value equal to
or greater than the property value are considered "high-cost" connections.
The default value is Integer.MAX_VALUE.highCost - The cost value that identifies a connection as "high-cost" for
connection labeling.UniversalConnectionPoolException - If an exception occurs while setting the cost.default int getHighCostConnectionReuseThreshold()
setConnectionLabelingHighCost,
setHighCostConnectionReuseThresholddefault void setHighCostConnectionReuseThreshold(int threshold)
throws UniversalConnectionPoolException
threshold - The high-cost connection reuse threshold to set.UniversalConnectionPoolException - If any exception occurs while setting the threshold.default int getMaxConnectionsPerService()
default void setMaxConnectionsPerService(int maxConnectionsPerService)
throws UniversalConnectionPoolException
maxConnectionsPerService - The maximum number of connections that can be obtained to a
particular service.UniversalConnectionPoolException - If any exception occurs while setting the
maxConnectionsPerService value.default int getConnectionRepurposeThreshold()
default void setConnectionRepurposeThreshold(java.lang.Integer threshold)
throws UniversalConnectionPoolException
threshold - connection repurpose threshold to set.UniversalConnectionPoolException - If any exception occurs while setting the threshold.getConnectionRepurposeThresholddefault int getLoginTimeout()
default void setLoginTimeout(int seconds)
throws UniversalConnectionPoolException
seconds - timeoutUniversalConnectionPoolException - in case of negative valuedefault boolean isShareable()
default void setShardingMode(boolean shardingMode)
shardingMode - Mode of UCP when using a Sharded Database.default boolean getShardingMode()
default void setConnectionValidationTimeout(int connectionValidationTimeout)
throws UniversalConnectionPoolException
connectionValidationTimeout - validation timeout in secondsUniversalConnectionPoolException - gets thrown in case of
negation timeout submitteddefault int getConnectionValidationTimeout()
default boolean isReadOnlyInstanceAllowed()
default void setReadOnlyInstanceAllowed(boolean readOnlyInstanceAllowed)
readOnlyInstanceAllowed - whether to allow connection borrow to a read-only instance or notdefault boolean isCreateConnectionInBorrowThread()
default void setCreateConnectionInBorrowThread(boolean createConnectionInBorrowThread)
If this property is set to false, a pool waits no longer than a designated connection wait duration no matter
how long it takes to create a new connection to grow a pool, if no connection is available at this moment.
If this property is set to true, then in this backward compatibility mode a pool waits for a connection to be
synchronously created in a borrow thread, and the waiting time can take longer than connectionWaitDuration.
For connectionWaitDuration please refer to
PoolDataSource.setConnectionWaitDuration(java.time.Duration).
createConnectionInBorrowThread - true, if in a borrow thread, false - if in background.default int getQueryTimeout()
default void setQueryTimeout(int queryTimeout)
throws UniversalConnectionPoolException
queryTimeout - in secondsUniversalConnectionPoolException - if unable to set.default boolean isCommitOnConnectionReturn()
default void setCommitOnConnectionReturn(boolean commit)
throws UniversalConnectionPoolException
commit - 'true' to commit, 'false' to rollback. The default is 'true'.UniversalConnectionPoolException - if an error occurs while setting the propertyjava.lang.String getUCPEventListenerProvider()
void setUCPEventListenerProvider(java.lang.String providerName)
throws UniversalConnectionPoolException
providerName - The name of the event listener provider (cannot be null, empty, or whitespace)UniversalConnectionPoolException - if providerName is null, empty, or contains only whitespacedefault void setPoolProperty(oracle.ucp.config.PoolProperty poolProperty,
java.lang.Object value,
int code)
throws UniversalConnectionPoolException
poolProperty - pool property to set.value - pool property value to set.code - error code to throw with UniversalConnectionPoolException.UniversalConnectionPoolException - this error is thrown if unable to set.default java.lang.Object getPoolProperty(oracle.ucp.config.PoolProperty poolProperty)
poolProperty - pool property to get.oracle.ucp.config.PoolProperties getPoolProperties()
Pool properties backbone getter.
This method returns the PoolProperties collection that contains the pool configuration.