Interface UniversalConnectionPoolMBean
-
Method Summary
Modifier and TypeMethodDescriptionGets the number of abandoned connections that have been reclaimed.Gets the abandoned connection timeout of the Universal Connection Pool instance.Gets the available connections count of the Universal Connection Pool instance.Gets the average number of connections that are borrowed and actively in use by clients.Gets the average time (in milliseconds) a user thread has to wait before it could obtain a connection from the connection pool.Gets the borrowed connections count of the Universal Connection Pool instance.Get in-memory trace buffer size.Get processing info for COLOCATION_TAG support.Gets the connection harvest maximum count of the Universal Connection Pool instance.Gets the connection harvest trigger count of the Universal Connection Pool instance.Returns the number of connection repurposed in a shared pool for a mutitenant database, where connections can be reused across PDB's by switching their container and PDB service.Gets the number of connections closed by this connection pool.Gets the number of connections created for this connection pool.Connection validation timeout getterReturns how much time a connection request call may wait before it either successfully returns a connection or throws an exception.Deprecated.Gets the number of connections borrowed from the connection pool over the life of the pool.Gets the number of connections returned to the connection pool over the life of the pool.Gets the cumulative time (in milliseconds) of connections that were borrowed from the pool and remained in use.Gets the cumulative time (in milliseconds) that connection requests have waited for connections over the life of the connection pool.Gets the number of connection requests that waited unsuccessfully to borrow a connection from the pool.Gets the cumulative time (in milliseconds) that connection requests waited but failed to borrow a connection from the pool.Gets the number of connection requests that waited successfully and borrowed a connection from the pool.Gets the cumulative time (in milliseconds) that connection requests waited successfully and borrowed a connection from the pool.Gets the number of borrow requests that returned connections not matching the affinity contexts.Gets the number of borrow requests failed using Runtime Connection Load-Balancing (RCLB) algorithms.Gets the information of recent Fast Connection Failover (FCF) attempts, in the form of a String.Gets the inactive connection timeout of the Universal Connection Pool instance.Gets the initial pool size of the Universal Connection Pool instance.Gets the number of labeled connections in the connection pool.Gets the lifecycle state of Universal Connection Pool instance.Get a current logging level.Gets the maximum connection reuse count of the Universal Connection Pool instance.Gets the maximum connection reuse time of the Universal Connection Pool instance.Gets the maximum pool size of the Universal Connection Pool instance.getMBeanInfo(ObjectName mbeanObjName, String mbeanDisplayName) BuildsMBeanInfoto define attributes, constructors, operations and notifications to expose to the remote users.Gets the minimum idle connections of the Universal Connection Pool instance.Gets the minimum pool size of the Universal Connection Pool instance.getName()Gets the name of the Universal Connection Pool instance.default IntegerGets the maximum number of borrowed connections that the connection pool has reached during the life of the pool.Gets the maximum number of connections that the connection pool has reached during the life of the pool.Gets the longest wait (in milliseconds) a user request has to incur before obtaining a connection from the connection pool.Gets the number of clients that are currently waiting to obtain a connection from the pool.Gets the number of connections that may be added to the pool before it reachesmaxPoolSize.Gets the seconds To Trust Idle Connection value.Returns total, borrowed and available connection counts to various shards discovered by the pool so far.Returns the mode of UCP when UCP is using a Sharded Database.Gets statistics for the Universal Connection Pool instance.Gets the number of borrow requests succeeded with matching affinity contexts.Gets the number of borrow requests succeeded using Runtime Connection Load-Balancing (RCLB) algorithms.Gets the timeout check interval of the Universal Connection Pool instance.Gets the time to live connection timeout of the Universal Connection Pool instance.Gets the total number of connections (both available and borrowed) in the connection pool.Builds the attribute information for the Universal Connection Pool MBean.Builds the operation information for the Universal Connection Pool MBean.Gets the validate connection on borrow value of the Universal Connection Pool instance.Returns the connection creation mode: either "true" if connections are created using the borrowing thread, or "false" if connections are created in the background (the default).Returns true if the connection borrow is allowed to a read-only instance, false otherwise.voidpurge()Purges the Universal Connection Pool instance.voidrecycle()Recycles the Universal Connection Pool instance.voidrefresh()Refreshes the Universal Connection Pool instance.voidsetAbandonedConnectionTimeout(Integer abandonedConnectionTimeout) Sets the abandoned connection timeout of the Universal Connection Pool instance.voidsetBufferSize(Integer bufferSize) Set in-memory trace buffer size.voidsetConnectionHarvestMaxCount(Integer connectionHarvestMaxCount) Sets the connection harvest maximum count for the Universal Connection Pool instance.voidsetConnectionHarvestTriggerCount(Integer connectionHarvestTriggerCount) Sets the connection harvest trigger count for the Universal Connection Pool instance.voidsetConnectionValidationTimeout(Integer connectionValidationTimeout) Connection validation timeout settervoidsetConnectionWaitDuration(Duration connectionWaitDuration) Configures how much time a connection request call may wait before it either successfully returns a connection or throws an exception.voidsetConnectionWaitTimeout(Integer connectionWaitTimeout) Deprecated.voidsetCreateConnectionInBorrowThread(Boolean createConnectionInBorrowThread) Set this flag to true to make UCP use the borrowing thread to create new connections.voidsetInactiveConnectionTimeout(Integer inactiveConnectionTimeout) Sets the inactive connection timeout.voidsetInitialPoolSize(Integer initialPoolSize) Sets the initial pool size of the Universal Connection Pool instance.voidsetLoggingEnabled(Boolean enabled) Enable or disable logging.voidsetLogLevel(Level logLevel) Set a current logging level.voidsetLogLevelStr(String logLevel) voidsetMaxConnectionReuseCount(Integer maxConnectionReuseCount) Sets the maximum connection reuse count for the Universal Connection Pool instance.voidsetMaxConnectionReuseTime(Long maxConnectionReuseTime) Sets the maximum connection reuse time for the Universal Connection Pool instance.voidsetMaxPoolSize(Integer maxPoolSize) Sets the maximum pool size of the Universal Connection Pool instance.voidsetMinIdle(Integer minIdle) Sets the minimum idle connections of the Universal Connection Pool instance.voidsetMinPoolSize(Integer minPoolSize) Sets the minimum pool size of the Universal Connection Pool instance.voidSets the name of the Universal Connection Pool instance.voidsetReadOnlyInstanceAllowed(Boolean readOnlyInstanceAllowed) Sets the read-only instance allowed value on the datasource.voidsetSecondsToTrustIdleConnection(Integer secondsToTrustIdleConnection) Sets the time in seconds to trust an idle connection to skip a validation test.voidsetShardingMode(Boolean shardingMode) This API changes the mode of UCP when UCP is using a Sharded Database.voidsetTimeoutCheckInterval(Integer timeoutCheckInterval) Sets the timeout check interval of the Universal Connection Pool instance.voidsetTimeToLiveConnectionTimeout(Integer timeToLiveConnectionTimeout) Sets the time to live connection timeout of the Universal Connection Pool instance.voidsetTraceEnabled(Boolean enabled) Enable or disable tracing.voidsetValidateConnectionOnBorrow(Boolean validateConnectionOnBorrow) Makes the pool validate the connection before returning it to the user by calling the JDBC API "isValid".voidstart()Starts the Universal Connection Pool instance.voidstop()Stops the Universal Connection Pool instance.voiduseStrictWebSessionAffinity(Boolean strict) The knob for switching strict web session affinityvoiduseStrictXAAffinity(Boolean strict) The knob for switching strict XA affinity
-
Method Details
-
refresh
Refreshes the Universal Connection Pool instance.- Throws:
UniversalConnectionPoolException- If an error occurs while refreshing the Universal Connection Pool instance.
-
recycle
Recycles the Universal Connection Pool instance.- Throws:
UniversalConnectionPoolException- If an error occurs while recycling the Universal Connection Pool instance.
-
purge
Purges the Universal Connection Pool instance.- Throws:
UniversalConnectionPoolException- If an error occurs while purging the Universal Connection Pool instance.
-
start
Starts the Universal Connection Pool instance.- Throws:
UniversalConnectionPoolException- If an error occurs while starting the Universal Connection Pool instance.
-
stop
Stops the Universal Connection Pool instance.- Throws:
UniversalConnectionPoolException- If an error occurs while stopping the Universal Connection Pool instance.
-
getName
String getName()Gets the name of the Universal Connection Pool instance.- Returns:
- String Returns the name.
-
setName
Sets the name of the Universal Connection Pool instance.- Parameters:
name- A new name for the Universal Connection Pool instance.- Throws:
UniversalConnectionPoolException- If an error occurs while changing the name.
-
getInitialPoolSize
Integer getInitialPoolSize()Gets the initial pool size of the Universal Connection Pool instance.- Returns:
- The initial pool size.
-
setInitialPoolSize
Sets the initial pool size of the Universal Connection Pool instance.- Parameters:
initialPoolSize- New initial pool size.- Throws:
UniversalConnectionPoolException- If an error occurs while changing the initial pool size.
-
getMinPoolSize
Integer getMinPoolSize()Gets the minimum pool size of the Universal Connection Pool instance.- Returns:
- The minimum pool size.
-
setMinPoolSize
Sets the minimum pool size of the Universal Connection Pool instance. The default is 1 connection.- Parameters:
minPoolSize- New minimum pool size.- Throws:
UniversalConnectionPoolException- If an error occurs while changing the minimum pool.
-
getMinIdle
Integer getMinIdle()Gets the minimum idle connections of the Universal Connection Pool instance.- Returns:
- The minimum idle connections.
-
setMinIdle
Sets the minimum idle connections of the Universal Connection Pool instance. The default is 0.- Parameters:
minIdle- New minimum idle pool size.- Throws:
UniversalConnectionPoolException- If an error occurs while changing the minimum idle.
-
getMaxPoolSize
Integer getMaxPoolSize()Gets the maximum pool size of the Universal Connection Pool instance.- Returns:
- The maximum pool size.
-
setMaxPoolSize
Sets the maximum pool size of the Universal Connection Pool instance. The default value is Integer.MAX_VALUE.- Parameters:
maxPoolSize- New maximum pool size.- Throws:
UniversalConnectionPoolException- If an error occurs while changing the maximum pool size.
-
getInactiveConnectionTimeout
Integer getInactiveConnectionTimeout()Gets the inactive connection timeout of the Universal Connection Pool instance.- Returns:
- The inactive connection timeout.
-
setInactiveConnectionTimeout
void setInactiveConnectionTimeout(Integer inactiveConnectionTimeout) throws UniversalConnectionPoolException Sets the inactive connection timeout.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.- Parameters:
inactiveConnectionTimeout- New inactive connection timeout.- Throws:
UniversalConnectionPoolException- If an error occurs while changing the inactive connection timeout.
-
getAbandonedConnectionTimeout
Integer getAbandonedConnectionTimeout()Gets the abandoned connection timeout of the Universal Connection Pool instance.- Returns:
- The abandoned connection timeout.
-
setAbandonedConnectionTimeout
void setAbandonedConnectionTimeout(Integer abandonedConnectionTimeout) throws UniversalConnectionPoolException Sets the abandoned connection timeout of the Universal Connection Pool instance.- Parameters:
abandonedConnectionTimeout- New abandoned connection timeout.- Throws:
UniversalConnectionPoolException- If an error occurs while changing the abandoned connection timeout.
-
getConnectionWaitTimeout
Deprecated.Returns how much time a connection request call may wait before it either successfully returns a connection or throws an exception.
This method is deprecated. Use
getConnectionWaitDuration()instead.- Returns:
- The connection wait timeout.
-
setConnectionWaitTimeout
@Deprecated void setConnectionWaitTimeout(Integer connectionWaitTimeout) throws UniversalConnectionPoolException Deprecated.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.
By default, the connection wait timeout is set to 3 seconds.
Setting the connection wait 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.
- Throws:
UniversalConnectionPoolException
-
getConnectionWaitDuration
Duration getConnectionWaitDuration()Returns how much time a connection request call may wait before it either successfully returns a connection or throws an exception.
A borrow request may end up creating a new JDBC connection. Therefore, starting in 23.1, the value returned by this method may be larger than the configured one because UCP adjusts it so that it's always equal or larger than the CONNECT_TIMEOUT of the JDBC driver.
- Returns:
- The connection wait duration.
- See Also:
-
setConnectionWaitDuration
void setConnectionWaitDuration(Duration connectionWaitDuration) 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.ZEROmakes 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.- Parameters:
connectionWaitDuration- The duration for a connection request to wait.- Throws:
UniversalConnectionPoolException- in case it was not possible to set timeout.
-
getTimeToLiveConnectionTimeout
Integer getTimeToLiveConnectionTimeout()Gets the time to live connection timeout of the Universal Connection Pool instance.- Returns:
- The time to live connection timeout.
-
setTimeToLiveConnectionTimeout
void setTimeToLiveConnectionTimeout(Integer timeToLiveConnectionTimeout) throws UniversalConnectionPoolException Sets the time to live connection timeout of the Universal Connection Pool instance.- Parameters:
timeToLiveConnectionTimeout- New time to live connection timeout.- Throws:
UniversalConnectionPoolException- If an error occurs while changing the time to live connection timeout.
-
getTimeoutCheckInterval
Integer getTimeoutCheckInterval()Gets the timeout check interval of the Universal Connection Pool instance.- Returns:
- The timeout check interval.
-
setTimeoutCheckInterval
Sets the timeout check interval of the Universal Connection Pool instance.- Parameters:
timeoutCheckInterval- New timeout check interval.- Throws:
UniversalConnectionPoolException- If an error occurs while changing the timeout check interval.
-
getValidateConnectionOnBorrow
Boolean getValidateConnectionOnBorrow()Gets the validate connection on borrow value of the Universal Connection Pool instance.- Returns:
- The validate connection on borrow value.
-
setValidateConnectionOnBorrow
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.
Default value is false.- Parameters:
validateConnectionOnBorrow- New validate connection on borrow value.- See Also:
-
getConnectionHarvestTriggerCount
Integer getConnectionHarvestTriggerCount()Gets the connection harvest trigger count of the Universal Connection Pool instance.- Returns:
- The connection harvest trigger count.
-
setConnectionHarvestTriggerCount
void setConnectionHarvestTriggerCount(Integer connectionHarvestTriggerCount) throws UniversalConnectionPoolException Sets the connection harvest trigger count for the Universal Connection Pool instance.- Parameters:
connectionHarvestTriggerCount- New connection harvest trigger count.- Throws:
UniversalConnectionPoolException- If an error occurs while changing the connection harvest trigger count.
-
getConnectionHarvestMaxCount
Integer getConnectionHarvestMaxCount()Gets the connection harvest maximum count of the Universal Connection Pool instance.- Returns:
- The connection harvest maximum count.
-
setConnectionHarvestMaxCount
void setConnectionHarvestMaxCount(Integer connectionHarvestMaxCount) throws UniversalConnectionPoolException Sets the connection harvest maximum count for the Universal Connection Pool instance.- Parameters:
connectionHarvestMaxCount- New connection harvest maximum count.- Throws:
UniversalConnectionPoolException- If an error occurs while changing the connection harvest maximum count.
-
getMaxConnectionReuseTime
Long getMaxConnectionReuseTime()Gets the maximum connection reuse time of the Universal Connection Pool instance.- Returns:
- The maximum connection reuse time.
-
setMaxConnectionReuseTime
Sets the maximum connection reuse time for the Universal Connection Pool instance.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.- Parameters:
maxConnectionReuseTime- New maximum connection reuse time (in seconds).- Throws:
UniversalConnectionPoolException- If an error occurs while changing the maximum connection reuse time.
-
getMaxConnectionReuseCount
Integer getMaxConnectionReuseCount()Gets the maximum connection reuse count of the Universal Connection Pool instance.- Returns:
- The maximum connection reuse count.
-
setMaxConnectionReuseCount
void setMaxConnectionReuseCount(Integer maxConnectionReuseCount) throws UniversalConnectionPoolException Sets the maximum connection reuse count for the Universal Connection Pool instance.- Parameters:
maxConnectionReuseCount- New maximum connection reuse count.- Throws:
UniversalConnectionPoolException- If an error occurs while changing the maximum connection reuse count.
-
setShardingMode
This API changes the mode of UCP when UCP is using a Sharded Database. By default UCP requires the caller to provide a sharding key for every connection request. When switching off the sharding mode, UCP behaves like a regular connection pool and all the sharding features are disabled so that a caller can request a connection without providing any sharding key.- Parameters:
shardingMode- Mode of UCP when using a Sharded Database.
-
getShardingMode
Boolean getShardingMode()Returns the mode of UCP when UCP is using a Sharded Database. By default sharding mode is ON which means UCP requires the caller to provide a sharding key for every connection request.- Returns:
- Mode of UCP when using a Sharded Database.
-
setConnectionValidationTimeout
void setConnectionValidationTimeout(Integer connectionValidationTimeout) throws UniversalConnectionPoolException Connection validation timeout setter- Parameters:
connectionValidationTimeout- timeout to set- Throws:
UniversalConnectionPoolException- in case of inability to set timeout.
-
getConnectionValidationTimeout
Integer getConnectionValidationTimeout()Connection validation timeout getter- Returns:
- the current connection validation timaout value in seconds
-
isCreateConnectionInBorrowThread
Boolean isCreateConnectionInBorrowThread()Returns the connection creation mode: either "true" if connections are created using the borrowing thread, or "false" if connections are created in the background (the default).- Returns:
- true, if creating connections in a borrow thread, false otherwise.
- See Also:
-
setCreateConnectionInBorrowThread
Set this flag to true to make UCP use the borrowing thread to create new connections. By default, connections are created in the background. The only reason why you may want to set this to "true" is to make a connection request fail-fast if the driver throws an exception while connecting; otherwise, the background task will keep trying until the connection wait timeout expires.
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).- Parameters:
createConnectionInBorrowThread- if true, create connections in a borrow thread.
-
isReadOnlyInstanceAllowed
Boolean isReadOnlyInstanceAllowed()Returns true if the connection borrow is allowed to a read-only instance, false otherwise. This property is applicable to sharded database only. A shard instance can be in read-only mode for a chunk if chunk move/split operation is in progress.- Returns:
- true if the connection borrow is allowed to a read-only instance, false otherwise.
-
setReadOnlyInstanceAllowed
Sets the read-only instance allowed value on the datasource. This property is applicable to sharded database only. When the property value is set to true, UCP allows connection borrow to read-only instances as well otherwise not. A shard instance goes into read-only mode for a chunk if the chunk move/split operation is in progress on that instance. The default value is false which means by default connection borrow is not allowed to a read-only instance.- Parameters:
readOnlyInstanceAllowed- whether to allow connection borrow to a read-only instance or not
-
getAvailableConnectionsCount
Integer getAvailableConnectionsCount()Gets the available connections count of the Universal Connection Pool instance.- Returns:
- The available connections count.
-
getBorrowedConnectionsCount
Integer getBorrowedConnectionsCount()Gets the borrowed connections count of the Universal Connection Pool instance.- Returns:
- The borrowed connections count.
-
getStatistics
String getStatistics()Gets statistics for the Universal Connection Pool instance.- Returns:
- The statistics.
-
getLifeCycleState
String getLifeCycleState()Gets the lifecycle state of Universal Connection Pool instance.- Returns:
- The lifecycle state.
-
getUCPMBeanAttributes
Builds the attribute information for the Universal Connection Pool MBean.- Returns:
ModelMBeanAttributeInfo[].- Throws:
UniversalConnectionPoolException- If an error occurs while gettingModelMBeanAttributeInfo[].
-
getUCPMBeanOperations
Builds the operation information for the Universal Connection Pool MBean.- Returns:
ModelMBeanOperationInfo[].- Throws:
UniversalConnectionPoolException- If an error occurs while gettingModelMBeanOperationInfo[].
-
getMBeanInfo
ModelMBeanInfo getMBeanInfo(ObjectName mbeanObjName, String mbeanDisplayName) throws UniversalConnectionPoolException BuildsMBeanInfoto define attributes, constructors, operations and notifications to expose to the remote users.- Parameters:
mbeanObjName- Unique name for the Universal Connection Pool MBean.mbeanDisplayName- Display name for the Universal Connection Pool MBean.- Returns:
ModelMBeanInfofor Universal Connection Pool MBean.- Throws:
UniversalConnectionPoolException- If an error occurs while gettingModelMBeanInfofor the Universal Connection Pool MBean.
-
useStrictWebSessionAffinity
The knob for switching strict web session affinity- Parameters:
strict- if strict, otherwise nonstrict
-
useStrictXAAffinity
The knob for switching strict XA affinity- Parameters:
strict- true if strict, otherwise non-strict
-
getSecondsToTrustIdleConnection
Integer getSecondsToTrustIdleConnection()Gets the seconds To Trust Idle Connection value. See property description insetSecondsToTrustIdleConnection().- Returns:
- Seconds To Trust Idle Connection value.
-
setSecondsToTrustIdleConnection
void setSecondsToTrustIdleConnection(Integer secondsToTrustIdleConnection) throws UniversalConnectionPoolException Sets the time in seconds to trust an idle connection to skip a validation test. It works in conjunction withsetValidateConnectionOnBorrow(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
- Parameters:
secondsToTrustIdleConnection- The value of how long a connection can be trusted to skip connectionValidationOnBorrow- Throws:
UniversalConnectionPoolException- in case of inability to set timeout
-
getTotalConnectionsCount
Integer getTotalConnectionsCount()Gets the total number of connections (both available and borrowed) in the connection pool.- Returns:
- The total number of connections (both available and borrowed) in the connection pool.
-
getAverageBorrowedConnectionsCount
Integer getAverageBorrowedConnectionsCount()Gets the average number of connections that are borrowed and actively in use by clients.- Returns:
- The number of connections that are borrowed and actively in use by clients.
-
getPeakConnectionsCount
Integer getPeakConnectionsCount()Gets the maximum number of connections that the connection pool has reached during the life of the pool.- Returns:
- The maximum number of connections that the connection pool has reached during the life of the pool.
-
getPeakBorrowedConnectionsCount
Gets the maximum number of borrowed connections that the connection pool has reached during the life of the pool.- Returns:
- The maximum number of borrowed connections that the connection pool has reached during the life of the pool.
-
getRemainingPoolCapacityCount
Integer getRemainingPoolCapacityCount()Gets the number of connections that may be added to the pool before it reachesmaxPoolSize.- Returns:
- The number of connections that may be added to the pool before
it reaches
maxPoolSize.
-
getLabeledConnectionsCount
Integer getLabeledConnectionsCount()Gets the number of labeled connections in the connection pool.- Returns:
- The number of labeled connections in the connection pool.
-
getConnectionsCreatedCount
Integer getConnectionsCreatedCount()Gets the number of connections created for this connection pool.- Returns:
- The number of connections created for this connection pool.
-
getConnectionsClosedCount
Integer getConnectionsClosedCount()Gets the number of connections closed by this connection pool.- Returns:
- The number of connections closed by this connection pool.
-
getAverageConnectionWaitTime
Long getAverageConnectionWaitTime()Gets the average time (in milliseconds) a user thread has to wait before it could obtain a connection from the connection pool.- Returns:
- The average time (in milliseconds) a user thread has to wait before it could obtain a connection from the connection pool.
-
getPeakConnectionWaitTime
Long getPeakConnectionWaitTime()Gets the longest wait (in milliseconds) a user request has to incur before obtaining a connection from the connection pool. This includes threads that waited unsuccessfully for a connection.- Returns:
- The longest wait (in milliseconds) a user request has to incur before obtaining a connection from the connection pool.
-
getAbandonedConnectionsCount
Integer getAbandonedConnectionsCount()Gets the number of abandoned connections that have been reclaimed.- Returns:
- The number of abandoned connections that have been reclaimed.
-
getPendingRequestsCount
Integer getPendingRequestsCount()Gets the number of clients that are currently waiting to obtain a connection from the pool.- Returns:
- The number of clients that are currently waiting to obtain a connection from the pool.
-
getCumulativeConnectionWaitTime
Long getCumulativeConnectionWaitTime()Gets the cumulative time (in milliseconds) that connection requests have waited for connections over the life of the connection pool. This includes the time connections waited successfully and obtained a connection from the pool and those that failed waiting for a connection.- Returns:
- The cumulative time (in milliseconds) that connection requests have waited for connections over the life of the connection pool.
-
getCumulativeConnectionBorrowedCount
Long getCumulativeConnectionBorrowedCount()Gets the number of connections borrowed from the connection pool over the life of the pool. This count is incremented each time a connection is borrowed.- Returns:
- The number of connections borrowed from the connection pool over the life of the pool.
-
getCumulativeConnectionUseTime
Long getCumulativeConnectionUseTime()Gets the cumulative time (in milliseconds) of connections that were borrowed from the pool and remained in use.- Returns:
- The cumulative time (in milliseconds) of connections that were borrowed from the pool and remained in use.
-
getCumulativeConnectionReturnedCount
Long getCumulativeConnectionReturnedCount()Gets the number of connections returned to the connection pool over the life of the pool.- Returns:
- The number of connections returned to the connection pool over the life of the pool.
-
getCumulativeSuccessfulConnectionWaitTime
Long getCumulativeSuccessfulConnectionWaitTime()Gets the cumulative time (in milliseconds) that connection requests waited successfully and borrowed a connection from the pool.- Returns:
- The cumulative time (in milliseconds) that connection requests waited successfully and borrowed a connection from the pool.
-
getCumulativeSuccessfulConnectionWaitCount
Long getCumulativeSuccessfulConnectionWaitCount()Gets the number of connection requests that waited successfully and borrowed a connection from the pool.- Returns:
- The number of connection requests that waited successfully and borrowed a connection from the pool.
-
getCumulativeFailedConnectionWaitTime
Long getCumulativeFailedConnectionWaitTime()Gets the cumulative time (in milliseconds) that connection requests waited but failed to borrow a connection from the pool.- Returns:
- The cumulative time (in milliseconds) that connection requests waited but failed to borrow a connection from the pool.
-
getCumulativeFailedConnectionWaitCount
Long getCumulativeFailedConnectionWaitCount()Gets the number of connection requests that waited unsuccessfully to borrow a connection from the pool.- Returns:
- The number of connection requests that waited unsuccessfully to borrow a connection from the pool.
-
getSuccessfulAffinityBasedBorrowCount
Long getSuccessfulAffinityBasedBorrowCount()Gets the number of borrow requests succeeded with matching affinity contexts.- Returns:
- The number of borrow requests succeeded with matching affinity contexts.
-
getFailedAffinityBasedBorrowCount
Long getFailedAffinityBasedBorrowCount()Gets the number of borrow requests that returned connections not matching the affinity contexts.- Returns:
- The number of borrow requests that returned connections not matching the affinity contexts.
-
getSuccessfulRCLBBasedBorrowCount
Long getSuccessfulRCLBBasedBorrowCount()Gets the number of borrow requests succeeded using Runtime Connection Load-Balancing (RCLB) algorithms.- Returns:
- The number of borrow requests succeeded using Runtime Connection Load-Balancing (RCLB) algorithms.
-
getFailedRCLBBasedBorrowCount
Long getFailedRCLBBasedBorrowCount()Gets the number of borrow requests failed using Runtime Connection Load-Balancing (RCLB) algorithms.- Returns:
- The number of borrow requests failed using Runtime Connection Load-Balancing (RCLB) algorithms.
-
getFcfProcessingInfo
String getFcfProcessingInfo()Gets the information of recent Fast Connection Failover (FCF) attempts, in the form of a String. The information returned is to help diagnosing FCF problems, and includes the outcome of each FCF attempt (successful or failed), the relevant RAC instances, the number of connections cleaned up, the exception that triggered the FCF attempt failure, etc.- Returns:
- The information string for recent FCF attempts.
-
getFcfProcessingInfoProcessedOnly
String getFcfProcessingInfoProcessedOnly() -
getConnectionRepurposeCount
Long getConnectionRepurposeCount()Returns the number of connection repurposed in a shared pool for a mutitenant database, where connections can be reused across PDB's by switching their container and PDB service.- Returns:
- repurpose count
-
getShardConnectionStats
String getShardConnectionStats()Returns total, borrowed and available connection counts to various shards discovered by the pool so far. These numbers are not cumulative, and only reflect the current connection counts at the time of this method call. -
getColocationStats
String getColocationStats()Get processing info for COLOCATION_TAG support. This currently contains only information on whether all the non-applicable HA features are disabled.- Returns:
- String with processing info for COLOCATION_TAG support.
-
getTraceEnabled
Boolean getTraceEnabled()- Returns:
- true, if trace is enabled.
-
setTraceEnabled
Enable or disable tracing. Tracing is the logging into a memory buffer and pushing that buffer in some special cases (some threshold logging level or errors of specified numbers)- Parameters:
enabled- true to enable tracing, false otherwise.
-
getLoggingEnabled
Boolean getLoggingEnabled()- Returns:
- true, if logging is enabled.
-
setLoggingEnabled
Enable or disable logging.- Parameters:
enabled- true to enable logging, false otherwise.
-
getLogLevel
Level getLogLevel()Get a current logging level.- Returns:
- current logging level.
-
getLogLevelStr
String getLogLevelStr() -
setLogLevel
Set a current logging level.- Parameters:
logLevel- current logging level to set.
-
setLogLevelStr
-
getBufferSize
Integer getBufferSize()Get in-memory trace buffer size.- Returns:
- current in-memory trace buffer size.
-
setBufferSize
Set in-memory trace buffer size.- Parameters:
bufferSize- current in-memory trace buffer size to set.
-