Class PerUserPoolDataSource
- java.lang.Object
-
- org.apache.tomcat.dbcp.dbcp2.datasources.InstanceKeyDataSource
-
- org.apache.tomcat.dbcp.dbcp2.datasources.PerUserPoolDataSource
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.AutoCloseable
,java.sql.Wrapper
,javax.naming.Referenceable
,javax.sql.CommonDataSource
,javax.sql.DataSource
public class PerUserPoolDataSource extends InstanceKeyDataSource
A pooling
DataSource
appropriate for deployment within J2EE environment. There are many configuration options, most of which are defined in the parent class. This datasource uses individual pools per user, and some properties can be set specifically for a given user, if the deployment environment can support initialization of mapped properties. So for example, a pool of admin or write-access Connections can be guaranteed a certain number of connections, separate from a maximum set for users with read-only connections.User passwords can be changed without re-initializing the datasource. When a
getConnection(userName, password)
request is processed with a password that is different from those used to create connections in the pool associated withuserName
, an attempt is made to create a new connection using the supplied password and if this succeeds, the existing pool is cleared and a new pool is created for connections using the new password.- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.tomcat.dbcp.dbcp2.datasources.InstanceKeyDataSource
UNKNOWN_TRANSACTIONISOLATION
-
-
Constructor Summary
Constructors Constructor Description PerUserPoolDataSource()
Default no-arg constructor for Serialization.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
clear()
Clears pool(s) maintained by this data source.void
close()
Closes pool(s) maintained by this data source.protected org.apache.tomcat.dbcp.dbcp2.datasources.PooledConnectionManager
getConnectionManager(org.apache.tomcat.dbcp.dbcp2.datasources.UserPassKey upKey)
int
getNumActive()
Gets the number of active connections in the default pool.int
getNumActive(java.lang.String userName)
Gets the number of active connections in the pool for a given user.int
getNumIdle()
Gets the number of idle connections in the default pool.int
getNumIdle(java.lang.String userName)
Gets the number of idle connections in the pool for a given user.boolean
getPerUserBlockWhenExhausted(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getBlockWhenExhausted()
for the specified user's pool or the default if no user specific value is defined.java.lang.Boolean
getPerUserDefaultAutoCommit(java.lang.String userName)
Gets the user specific default value forConnection.setAutoCommit(boolean)
for the specified user's pool.java.lang.Boolean
getPerUserDefaultReadOnly(java.lang.String userName)
Gets the user specific default value forConnection.setReadOnly(boolean)
for the specified user's pool.java.lang.Integer
getPerUserDefaultTransactionIsolation(java.lang.String userName)
Gets the user specific default value forConnection.setTransactionIsolation(int)
for the specified user's pool.java.time.Duration
getPerUserDurationBetweenEvictionRuns(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getDurationBetweenEvictionRuns()
for the specified user's pool or the default if no user specific value is defined.java.lang.String
getPerUserEvictionPolicyClassName(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getEvictionPolicyClassName()
for the specified user's pool or the default if no user specific value is defined.boolean
getPerUserLifo(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getLifo()
for the specified user's pool or the default if no user specific value is defined.int
getPerUserMaxIdle(java.lang.String userName)
Gets the user specific value forGenericObjectPool.getMaxIdle()
for the specified user's pool or the default if no user specific value is defined.int
getPerUserMaxTotal(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getMaxTotal()
for the specified user's pool or the default if no user specific value is defined.java.time.Duration
getPerUserMaxWaitDuration(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getMaxWaitDuration()
for the specified user's pool or the default if no user specific value is defined.long
getPerUserMaxWaitMillis(java.lang.String userName)
Deprecated.java.time.Duration
getPerUserMinEvictableIdleDuration(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getMinEvictableIdleDuration()
for the specified user's pool or the default if no user specific value is defined.long
getPerUserMinEvictableIdleTimeMillis(java.lang.String userName)
Deprecated.int
getPerUserMinIdle(java.lang.String userName)
Gets the user specific value forGenericObjectPool.getMinIdle()
for the specified user's pool or the default if no user specific value is defined.int
getPerUserNumTestsPerEvictionRun(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getNumTestsPerEvictionRun()
for the specified user's pool or the default if no user specific value is defined.java.time.Duration
getPerUserSoftMinEvictableIdleDuration(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getSoftMinEvictableIdleDuration()
for the specified user's pool or the default if no user specific value is defined.long
getPerUserSoftMinEvictableIdleTimeMillis(java.lang.String userName)
Deprecated.boolean
getPerUserTestOnBorrow(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getTestOnBorrow()
for the specified user's pool or the default if no user specific value is defined.boolean
getPerUserTestOnCreate(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getTestOnCreate()
for the specified user's pool or the default if no user specific value is defined.boolean
getPerUserTestOnReturn(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getTestOnReturn()
for the specified user's pool or the default if no user specific value is defined.boolean
getPerUserTestWhileIdle(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getTestWhileIdle()
for the specified user's pool or the default if no user specific value is defined.long
getPerUserTimeBetweenEvictionRunsMillis(java.lang.String userName)
Deprecated.protected org.apache.tomcat.dbcp.dbcp2.datasources.PooledConnectionAndInfo
getPooledConnectionAndInfo(java.lang.String userName, java.lang.String password)
This method is protected but can only be implemented in this package because PooledConnectionAndInfo is a package private type.javax.naming.Reference
getReference()
Returns aPerUserPoolDataSource
Reference
.void
setPerUserBlockWhenExhausted(java.lang.String userName, java.lang.Boolean value)
Sets a user specific value forBaseGenericObjectPool.getBlockWhenExhausted()
for the specified user's pool.void
setPerUserDefaultAutoCommit(java.lang.String userName, java.lang.Boolean value)
Sets a user specific default value forConnection.setAutoCommit(boolean)
for the specified user's pool.void
setPerUserDefaultReadOnly(java.lang.String userName, java.lang.Boolean value)
Sets a user specific default value forConnection.setReadOnly(boolean)
for the specified user's pool.void
setPerUserDefaultTransactionIsolation(java.lang.String userName, java.lang.Integer value)
Sets a user specific default value forConnection.setTransactionIsolation(int)
for the specified user's pool.void
setPerUserDurationBetweenEvictionRuns(java.lang.String userName, java.time.Duration value)
Sets a user specific value forBaseGenericObjectPool.getDurationBetweenEvictionRuns()
for the specified user's pool.void
setPerUserEvictionPolicyClassName(java.lang.String userName, java.lang.String value)
Sets a user specific value forBaseGenericObjectPool.getEvictionPolicyClassName()
for the specified user's pool.void
setPerUserLifo(java.lang.String userName, java.lang.Boolean value)
Sets a user specific value forBaseGenericObjectPool.getLifo()
for the specified user's pool.void
setPerUserMaxIdle(java.lang.String userName, java.lang.Integer value)
Sets a user specific value forGenericObjectPool.getMaxIdle()
for the specified user's pool.void
setPerUserMaxTotal(java.lang.String userName, java.lang.Integer value)
Sets a user specific value forBaseGenericObjectPool.getMaxTotal()
for the specified user's pool.void
setPerUserMaxWait(java.lang.String userName, java.time.Duration value)
Sets a user specific value forBaseGenericObjectPool.getMaxWaitDuration()
for the specified user's pool.void
setPerUserMaxWaitMillis(java.lang.String userName, java.lang.Long value)
Deprecated.void
setPerUserMinEvictableIdle(java.lang.String userName, java.time.Duration value)
Sets a user specific value forBaseGenericObjectPool.getMinEvictableIdleDuration()
for the specified user's pool.void
setPerUserMinEvictableIdleTimeMillis(java.lang.String userName, java.lang.Long value)
Deprecated.void
setPerUserMinIdle(java.lang.String userName, java.lang.Integer value)
Sets a user specific value forGenericObjectPool.getMinIdle()
for the specified user's pool.void
setPerUserNumTestsPerEvictionRun(java.lang.String userName, java.lang.Integer value)
Sets a user specific value forBaseGenericObjectPool.getNumTestsPerEvictionRun()
for the specified user's pool.void
setPerUserSoftMinEvictableIdle(java.lang.String userName, java.time.Duration value)
Sets a user specific value forBaseGenericObjectPool.getSoftMinEvictableIdleDuration()
for the specified user's pool.void
setPerUserSoftMinEvictableIdleTimeMillis(java.lang.String userName, java.lang.Long value)
Deprecated.void
setPerUserTestOnBorrow(java.lang.String userName, java.lang.Boolean value)
Sets a user specific value forBaseGenericObjectPool.getTestOnBorrow()
for the specified user's pool.void
setPerUserTestOnCreate(java.lang.String userName, java.lang.Boolean value)
Sets a user specific value forBaseGenericObjectPool.getTestOnCreate()
for the specified user's pool.void
setPerUserTestOnReturn(java.lang.String userName, java.lang.Boolean value)
Sets a user specific value forBaseGenericObjectPool.getTestOnReturn()
for the specified user's pool.void
setPerUserTestWhileIdle(java.lang.String userName, java.lang.Boolean value)
Sets a user specific value forBaseGenericObjectPool.getTestWhileIdle()
for the specified user's pool.void
setPerUserTimeBetweenEvictionRunsMillis(java.lang.String userName, java.lang.Long value)
Deprecated.protected void
setupDefaults(java.sql.Connection con, java.lang.String userName)
-
Methods inherited from class org.apache.tomcat.dbcp.dbcp2.datasources.InstanceKeyDataSource
assertInitializationAllowed, getConnection, getConnection, getConnectionPoolDataSource, getDataSourceName, getDefaultBlockWhenExhausted, getDefaultDurationBetweenEvictionRuns, getDefaultEvictionPolicyClassName, getDefaultLifo, getDefaultMaxIdle, getDefaultMaxTotal, getDefaultMaxWait, getDefaultMaxWaitMillis, getDefaultMinEvictableIdleDuration, getDefaultMinEvictableIdleTimeMillis, getDefaultMinIdle, getDefaultNumTestsPerEvictionRun, getDefaultSoftMinEvictableIdleDuration, getDefaultSoftMinEvictableIdleTimeMillis, getDefaultTestOnBorrow, getDefaultTestOnCreate, getDefaultTestOnReturn, getDefaultTestWhileIdle, getDefaultTimeBetweenEvictionRunsMillis, getDefaultTransactionIsolation, getDescription, getInstanceKey, getJndiEnvironment, getLoginTimeout, getLoginTimeoutDuration, getLogWriter, getMaxConnDuration, getMaxConnLifetime, getMaxConnLifetimeMillis, getParentLogger, getValidationQuery, getValidationQueryTimeout, getValidationQueryTimeoutDuration, isDefaultAutoCommit, isDefaultReadOnly, isRollbackAfterValidation, isWrapperFor, setConnectionPoolDataSource, setDataSourceName, setDefaultAutoCommit, setDefaultBlockWhenExhausted, setDefaultDurationBetweenEvictionRuns, setDefaultEvictionPolicyClassName, setDefaultLifo, setDefaultMaxIdle, setDefaultMaxTotal, setDefaultMaxWait, setDefaultMaxWaitMillis, setDefaultMinEvictableIdle, setDefaultMinEvictableIdleTimeMillis, setDefaultMinIdle, setDefaultNumTestsPerEvictionRun, setDefaultReadOnly, setDefaultSoftMinEvictableIdle, setDefaultSoftMinEvictableIdleTimeMillis, setDefaultTestOnBorrow, setDefaultTestOnCreate, setDefaultTestOnReturn, setDefaultTestWhileIdle, setDefaultTimeBetweenEvictionRunsMillis, setDefaultTransactionIsolation, setDescription, setJndiEnvironment, setLoginTimeout, setLoginTimeout, setLogWriter, setMaxConnLifetime, setMaxConnLifetimeMillis, setRollbackAfterValidation, setValidationQuery, setValidationQueryTimeout, setValidationQueryTimeout, testCPDS, toString, toStringFields, unwrap
-
-
-
-
Method Detail
-
clear
public void clear()
Clears pool(s) maintained by this data source.- Since:
- 2.3.0
- See Also:
ObjectPool.clear()
-
close
public void close()
Closes pool(s) maintained by this data source.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in classInstanceKeyDataSource
- See Also:
ObjectPool.close()
-
getConnectionManager
protected org.apache.tomcat.dbcp.dbcp2.datasources.PooledConnectionManager getConnectionManager(org.apache.tomcat.dbcp.dbcp2.datasources.UserPassKey upKey)
- Specified by:
getConnectionManager
in classInstanceKeyDataSource
-
getNumActive
public int getNumActive()
Gets the number of active connections in the default pool.- Returns:
- The number of active connections in the default pool.
-
getNumActive
public int getNumActive(java.lang.String userName)
Gets the number of active connections in the pool for a given user.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getNumIdle
public int getNumIdle()
Gets the number of idle connections in the default pool.- Returns:
- The number of idle connections in the default pool.
-
getNumIdle
public int getNumIdle(java.lang.String userName)
Gets the number of idle connections in the pool for a given user.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserBlockWhenExhausted
public boolean getPerUserBlockWhenExhausted(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getBlockWhenExhausted()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserDefaultAutoCommit
public java.lang.Boolean getPerUserDefaultAutoCommit(java.lang.String userName)
Gets the user specific default value forConnection.setAutoCommit(boolean)
for the specified user's pool.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserDefaultReadOnly
public java.lang.Boolean getPerUserDefaultReadOnly(java.lang.String userName)
Gets the user specific default value forConnection.setReadOnly(boolean)
for the specified user's pool.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserDefaultTransactionIsolation
public java.lang.Integer getPerUserDefaultTransactionIsolation(java.lang.String userName)
Gets the user specific default value forConnection.setTransactionIsolation(int)
for the specified user's pool.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserDurationBetweenEvictionRuns
public java.time.Duration getPerUserDurationBetweenEvictionRuns(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getDurationBetweenEvictionRuns()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
- Since:
- 2.10.0
-
getPerUserEvictionPolicyClassName
public java.lang.String getPerUserEvictionPolicyClassName(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getEvictionPolicyClassName()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserLifo
public boolean getPerUserLifo(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getLifo()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserMaxIdle
public int getPerUserMaxIdle(java.lang.String userName)
Gets the user specific value forGenericObjectPool.getMaxIdle()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserMaxTotal
public int getPerUserMaxTotal(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getMaxTotal()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserMaxWaitDuration
public java.time.Duration getPerUserMaxWaitDuration(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getMaxWaitDuration()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
- Since:
- 2.10.0
-
getPerUserMaxWaitMillis
@Deprecated public long getPerUserMaxWaitMillis(java.lang.String userName)
Deprecated.Gets the user specific value forBaseGenericObjectPool.getMaxWaitDuration()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserMinEvictableIdleDuration
public java.time.Duration getPerUserMinEvictableIdleDuration(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getMinEvictableIdleDuration()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value, never null.
- Since:
- 2.10.0
-
getPerUserMinEvictableIdleTimeMillis
@Deprecated public long getPerUserMinEvictableIdleTimeMillis(java.lang.String userName)
Deprecated.Gets the user specific value forBaseGenericObjectPool.getMinEvictableIdleDuration()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserMinIdle
public int getPerUserMinIdle(java.lang.String userName)
Gets the user specific value forGenericObjectPool.getMinIdle()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserNumTestsPerEvictionRun
public int getPerUserNumTestsPerEvictionRun(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getNumTestsPerEvictionRun()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserSoftMinEvictableIdleDuration
public java.time.Duration getPerUserSoftMinEvictableIdleDuration(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getSoftMinEvictableIdleDuration()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
- Since:
- 2.10.0
-
getPerUserSoftMinEvictableIdleTimeMillis
@Deprecated public long getPerUserSoftMinEvictableIdleTimeMillis(java.lang.String userName)
Deprecated.Gets the user specific value forBaseGenericObjectPool.getSoftMinEvictableIdleDuration()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserTestOnBorrow
public boolean getPerUserTestOnBorrow(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getTestOnBorrow()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserTestOnCreate
public boolean getPerUserTestOnCreate(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getTestOnCreate()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserTestOnReturn
public boolean getPerUserTestOnReturn(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getTestOnReturn()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserTestWhileIdle
public boolean getPerUserTestWhileIdle(java.lang.String userName)
Gets the user specific value forBaseGenericObjectPool.getTestWhileIdle()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPerUserTimeBetweenEvictionRunsMillis
@Deprecated public long getPerUserTimeBetweenEvictionRunsMillis(java.lang.String userName)
Deprecated.Gets the user specific value forBaseGenericObjectPool.getDurationBetweenEvictionRuns()
for the specified user's pool or the default if no user specific value is defined.- Parameters:
userName
- The user name key.- Returns:
- The user specific value.
-
getPooledConnectionAndInfo
protected org.apache.tomcat.dbcp.dbcp2.datasources.PooledConnectionAndInfo getPooledConnectionAndInfo(java.lang.String userName, java.lang.String password) throws java.sql.SQLException
Description copied from class:InstanceKeyDataSource
This method is protected but can only be implemented in this package because PooledConnectionAndInfo is a package private type.- Specified by:
getPooledConnectionAndInfo
in classInstanceKeyDataSource
- Parameters:
userName
- The user name.password
- The user password.- Returns:
- Matching PooledConnectionAndInfo.
- Throws:
java.sql.SQLException
- Connection or registration failure.
-
getReference
public javax.naming.Reference getReference() throws javax.naming.NamingException
Returns aPerUserPoolDataSource
Reference
.- Throws:
javax.naming.NamingException
-
setPerUserBlockWhenExhausted
public void setPerUserBlockWhenExhausted(java.lang.String userName, java.lang.Boolean value)
Sets a user specific value forBaseGenericObjectPool.getBlockWhenExhausted()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserDefaultAutoCommit
public void setPerUserDefaultAutoCommit(java.lang.String userName, java.lang.Boolean value)
Sets a user specific default value forConnection.setAutoCommit(boolean)
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserDefaultReadOnly
public void setPerUserDefaultReadOnly(java.lang.String userName, java.lang.Boolean value)
Sets a user specific default value forConnection.setReadOnly(boolean)
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserDefaultTransactionIsolation
public void setPerUserDefaultTransactionIsolation(java.lang.String userName, java.lang.Integer value)
Sets a user specific default value forConnection.setTransactionIsolation(int)
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserDurationBetweenEvictionRuns
public void setPerUserDurationBetweenEvictionRuns(java.lang.String userName, java.time.Duration value)
Sets a user specific value forBaseGenericObjectPool.getDurationBetweenEvictionRuns()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.- Since:
- 2.10.0
-
setPerUserEvictionPolicyClassName
public void setPerUserEvictionPolicyClassName(java.lang.String userName, java.lang.String value)
Sets a user specific value forBaseGenericObjectPool.getEvictionPolicyClassName()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserLifo
public void setPerUserLifo(java.lang.String userName, java.lang.Boolean value)
Sets a user specific value forBaseGenericObjectPool.getLifo()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserMaxIdle
public void setPerUserMaxIdle(java.lang.String userName, java.lang.Integer value)
Sets a user specific value forGenericObjectPool.getMaxIdle()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserMaxTotal
public void setPerUserMaxTotal(java.lang.String userName, java.lang.Integer value)
Sets a user specific value forBaseGenericObjectPool.getMaxTotal()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserMaxWait
public void setPerUserMaxWait(java.lang.String userName, java.time.Duration value)
Sets a user specific value forBaseGenericObjectPool.getMaxWaitDuration()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.- Since:
- 2.10.0
-
setPerUserMaxWaitMillis
@Deprecated public void setPerUserMaxWaitMillis(java.lang.String userName, java.lang.Long value)
Deprecated.Sets a user specific value forBaseGenericObjectPool.getMaxWaitDuration()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserMinEvictableIdle
public void setPerUserMinEvictableIdle(java.lang.String userName, java.time.Duration value)
Sets a user specific value forBaseGenericObjectPool.getMinEvictableIdleDuration()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.- Since:
- 2.10.0
-
setPerUserMinEvictableIdleTimeMillis
@Deprecated public void setPerUserMinEvictableIdleTimeMillis(java.lang.String userName, java.lang.Long value)
Deprecated.Sets a user specific value forBaseGenericObjectPool.getMinEvictableIdleDuration()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserMinIdle
public void setPerUserMinIdle(java.lang.String userName, java.lang.Integer value)
Sets a user specific value forGenericObjectPool.getMinIdle()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserNumTestsPerEvictionRun
public void setPerUserNumTestsPerEvictionRun(java.lang.String userName, java.lang.Integer value)
Sets a user specific value forBaseGenericObjectPool.getNumTestsPerEvictionRun()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserSoftMinEvictableIdle
public void setPerUserSoftMinEvictableIdle(java.lang.String userName, java.time.Duration value)
Sets a user specific value forBaseGenericObjectPool.getSoftMinEvictableIdleDuration()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.- Since:
- 2.10.0
-
setPerUserSoftMinEvictableIdleTimeMillis
@Deprecated public void setPerUserSoftMinEvictableIdleTimeMillis(java.lang.String userName, java.lang.Long value)
Deprecated.Sets a user specific value forBaseGenericObjectPool.getSoftMinEvictableIdleDuration()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserTestOnBorrow
public void setPerUserTestOnBorrow(java.lang.String userName, java.lang.Boolean value)
Sets a user specific value forBaseGenericObjectPool.getTestOnBorrow()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserTestOnCreate
public void setPerUserTestOnCreate(java.lang.String userName, java.lang.Boolean value)
Sets a user specific value forBaseGenericObjectPool.getTestOnCreate()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserTestOnReturn
public void setPerUserTestOnReturn(java.lang.String userName, java.lang.Boolean value)
Sets a user specific value forBaseGenericObjectPool.getTestOnReturn()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserTestWhileIdle
public void setPerUserTestWhileIdle(java.lang.String userName, java.lang.Boolean value)
Sets a user specific value forBaseGenericObjectPool.getTestWhileIdle()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setPerUserTimeBetweenEvictionRunsMillis
@Deprecated public void setPerUserTimeBetweenEvictionRunsMillis(java.lang.String userName, java.lang.Long value)
Deprecated.Sets a user specific value forBaseGenericObjectPool.getDurationBetweenEvictionRuns()
for the specified user's pool.- Parameters:
userName
- The user name key.value
- The user specific value.
-
setupDefaults
protected void setupDefaults(java.sql.Connection con, java.lang.String userName) throws java.sql.SQLException
- Specified by:
setupDefaults
in classInstanceKeyDataSource
- Throws:
java.sql.SQLException
-
-