Class PerUserPoolDataSource

java.lang.Object
org.apache.tomcat.dbcp.dbcp2.datasources.InstanceKeyDataSource
org.apache.tomcat.dbcp.dbcp2.datasources.PerUserPoolDataSource
All Implemented Interfaces:
Serializable, AutoCloseable, Wrapper, Referenceable, CommonDataSource, 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 with userName, 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: