org.apache.tomcat.jdbc.pool.ConnectionPool is optimized to do as little work as possible.
The pool itself doesn't remember settings like java.sql.Connection#setAutoCommit(boolean) ,
java.sql.Connection#setReadOnly(boolean) , java.sql.Connection#setCatalog(String) or
java.sql.Connection#setTransactionIsolation(int) . It relies on the application to remember how and when
these settings have been applied.
In the cases where the application code doesn't know or want to keep track of the state, this interceptor helps cache the
state, and it also avoids roundtrips to the database asking for it.
| Modifier and Type | Field and Description |
|---|---|
| protected Boolean | |
| protected String | |
| private static final Log | |
| protected Boolean | |
| protected final String[] | |
| protected Integer | |
| protected final String[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | disconnected(ConnectionPool
- the connection pool that this connection belongs to parent, PooledConnection - the pooled connection that holds this connection con, boolean - if this connection is finalizing. True means that the pooled connection will not reconnect the underlying connection finalizing)Overrides org. Called when |
| public Object | invoke(Object
the proxy instance that the method was invoked on proxy, Method the method, Object[] Method instance corresponding to
the interface method invoked on the proxy instance. The declaring
class of the Method object will be the interface that
the method was declared in, which may be a superinterface of the
proxy interface that the proxy class inherits the method through.an array of objects containing the values of the
arguments passed in the method invocation on the proxy instance,
or args)null if interface method takes no arguments.
Arguments of primitive types are wrapped in instances of the
appropriate primitive wrapper class, such as
java.lang.Integer or java.lang.Boolean.Overrides org. Implements java. Gets invoked each time an operation on |
| public void | reset(ConnectionPool
- the connection pool owning the connection parent, PooledConnection - the pooled connection con)Implements abstract org. Gets called each time the connection is borrowed from the pool This means that if an interceptor holds a reference to the connection the interceptor can be reused for another connection. |
| autoCommit | back to summary |
|---|---|
| protected Boolean autoCommit | |
| catalog | back to summary |
|---|---|
| protected String catalog | |
| log | back to summary |
|---|---|
| private static final Log log | |
| readOnly | back to summary |
|---|---|
| protected Boolean readOnly | |
| readState | back to summary |
|---|---|
| protected final String[] readState | |
| transactionIsolation | back to summary |
|---|---|
| protected Integer transactionIsolation | |
| writeState | back to summary |
|---|---|
| protected final String[] writeState | |
| ConnectionState | back to summary |
|---|---|
| public ConnectionState() | |
| disconnected | back to summary |
|---|---|
| public void disconnected(ConnectionPool parent, PooledConnection con, boolean finalizing) Overrides org. Doc from org. Called when
| |
| invoke | back to summary |
|---|---|
| public Object invoke(Object proxy, Method method, Object[] args) throws Throwable Overrides org. Implements java. Doc from org. Gets invoked each time an operation on
| |
| reset | back to summary |
|---|---|
| public void reset(ConnectionPool parent, PooledConnection con) Implements abstract org. Doc from org. Gets called each time the connection is borrowed from the pool
This means that if an interceptor holds a reference to the connection
the interceptor can be reused for another connection.
| |