MultiTenantConnectionProvider implementations using
individual ConnectionProvider instances per tenant behind the scenes.
This class is meant to be subclassed to implement application-specific requirements.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Connection | getAnyConnection()
Implements org. |
| protected abstract ConnectionProvider | |
| public Connection | getConnection(T
The identifier of the tenant for which to get a connection tenantIdentifier)Implements org. |
| public boolean | isUnwrappableAs(Class<?>
The type to check. unwrapType)Implements org. |
| public void | releaseAnyConnection(Connection
The JDBC connection to release connection)Implements org. getAnyConnection
|
| public void | releaseConnection(T
The identifier of the tenant. tenantIdentifier, Connection The JDBC connection to release connection)Implements org. |
| protected abstract ConnectionProvider | |
| public boolean | supportsAggressiveRelease()
Implements org. |
| public <T> T | unwrap(Class<T>
The java type as which to unwrap this instance. unwrapType)Implements org. |
| AbstractMultiTenantConnectionProvider | back to summary |
|---|---|
| public AbstractMultiTenantConnectionProvider() | |
| getAnyConnection | back to summary |
|---|---|
| public Connection getAnyConnection() throws SQLException Implements org. Doc from org. Allows access to the database metadata of the underlying database(s) in situations where we do not have a tenant id (like startup processing, for example).
| |
| getAnyConnectionProvider | back to summary |
|---|---|
| protected abstract ConnectionProvider getAnyConnectionProvider() | |
| getConnection | back to summary |
|---|---|
| public Connection getConnection(T tenantIdentifier) throws SQLException Implements org. Doc from org. Obtains a connection for use according to the underlying strategy of this provider.
| |
| isUnwrappableAs | back to summary |
|---|---|
| public boolean isUnwrappableAs(Class<?> unwrapType) Implements org. Doc from org. Can this wrapped service be unwrapped as the indicated type? | |
| releaseAnyConnection | back to summary |
|---|---|
| public void releaseAnyConnection(Connection connection) throws SQLException Implements org. Doc from org. Release a connection obtained from
| |
| releaseConnection | back to summary |
|---|---|
| public void releaseConnection(T tenantIdentifier, Connection connection) throws SQLException Implements org. Doc from org. Release a connection from Hibernate use.
| |
| selectConnectionProvider | back to summary |
|---|---|
| protected abstract ConnectionProvider selectConnectionProvider(T tenantIdentifier) | |
| supportsAggressiveRelease | back to summary |
|---|---|
| public boolean supportsAggressiveRelease() Implements org. Doc from org. Does this connection provider support aggressive release of JDBC connections and later re-acquisition of those connections if needed?
This is used in conjunction with Typically, this is only true in managed environments where a container tracks connections by transaction or thread. Note that JTA semantic depends on the fact that the underlying connection provider does support aggressive release.
| |
| unwrap | back to summary |
|---|---|
| public <T> T unwrap(Class<T> unwrapType) Implements org. Doc from org. Unproxy the service proxy
| |