| Modifier and Type | Field and Description |
|---|---|
| private int | eventIterators
The number of iterators going through the list of connection event listeners at the current time. |
| private ArrayList | listeners_
List of |
| private LogicalConnection | logicalConnection_
The logical connection using the physical connection. |
| protected LogWriter | |
| pack-priv NetXAConnection | |
| private boolean | newPC_
Tells if this pooled connection is newly created. |
| pack-priv ClientConnection | |
| protected int | rmId_
Resource manager identifier. |
| private final JDBCStatementCache | statementCache
The statement cache for the underlying physical connection. |
| private final CopyOnWriteArrayList | statementEventListeners
List of statement event listeners. |
| Access | Constructor and Description |
|---|---|
| public | ClientPooledConnection(BasicClientDataSource
data source creating this pooled connection ds, LogWriter destination for log messages logWriter, String user name user, String user password password)Constructor for non-XA pooled connections. |
| public | ClientPooledConnection(BasicClientDataSource
data source creating this pooled connection ds, LogWriter destination for log messages logWriter, String user name user, String user password password, int resource manager id rmId)Constructor for XA pooled connections only. |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | addConnectionEventListener(ConnectionEventListener
a component, usually the connection pool manager,
that has implemented the
listener)ConnectionEventListener interface and wants to be
notified when the connection is closed or has an errorImplements javax. PooledConnection object.
|
| public void | addStatementEventListener(StatementEventListener
A component that implements the StatementEventListener
interface and wants to be notified of Statement closed or or Statement
error occurred events listener)Implements javax. |
| public synchronized void | close()
Implements javax. |
| private void | createLogicalConnection()
Creates a new logical connection by performing all the required steps to be able to reuse the physical connection. |
| protected void | finalize()
Overrides java. |
| private void | fireConnectionEventListeners(SqlException
the exception that caused the event, or exception)null if
it is a close eventFire all the |
| public synchronized Connection | |
| public void | informListeners(SqlException
the exception that occurred on the connection exception)Inform listeners that an error has occured on the connection, if the error severity is high enough. |
| public boolean | Returns: true if enabled, false if disabled.Tells is statement pooling is enabled or not. |
| public synchronized void | nullLogicalConnection()
Used by |
| public void | onStatementClose(PreparedStatement
The PreparedStatement that was closed statement)Raise the statementClosed event for all the listeners when the corresponding events occurs. |
| public void | onStatementErrorOccurred(PreparedStatement
The PreparedStatement on which error occurred statement, SQLException The SQLException associated with the error that caused the
invalidation of the PreparedStatements sqle)Raise the statementErrorOccurred event for all the listeners when the corresponding events occurs. |
| public synchronized void | recycleConnection()
Inform listeners that the logical connection has been closed and that the physical connection is ready for reuse. |
| public synchronized void | removeConnectionEventListener(ConnectionEventListener
a component, usually the connection pool manager,
that has implemented the
listener)ConnectionEventListener interface and
been registered with this PooledConnection object as
a listenerImplements javax. PooledConnection object.
|
| public void | removeStatementEventListener(StatementEventListener
The previously registered event listener that needs to be
removed from the list of components listener)Implements javax. |
| eventIterators | back to summary |
|---|---|
| private int eventIterators The number of iterators going through the list of connection event listeners at the current time. Only one thread may be iterating over the list at any time (because of synchronization), but a single thread may have multiple iterators if for instance an event listener performs database calls that trigger a new event. | |
| listeners_ | back to summary |
|---|---|
| private ArrayList<ConnectionEventListener> listeners_ List of | |
| logicalConnection_ | back to summary |
|---|---|
| private LogicalConnection logicalConnection_ The logical connection using the physical connection. | |
| logWriter_ | back to summary |
|---|---|
| protected LogWriter logWriter_ | |
| netXAPhysicalConnection_ | back to summary |
|---|---|
| pack-priv NetXAConnection netXAPhysicalConnection_ | |
| newPC_ | back to summary |
|---|---|
| private boolean newPC_ Tells if this pooled connection is newly created. | |
| physicalConnection_ | back to summary |
|---|---|
| pack-priv ClientConnection physicalConnection_ | |
| rmId_ | back to summary |
|---|---|
| protected int rmId_ Resource manager identifier. | |
| statementCache | back to summary |
|---|---|
| private final JDBCStatementCache statementCache The statement cache for the underlying physical connection.
This will be | |
| statementEventListeners | back to summary |
|---|---|
| private final CopyOnWriteArrayList<StatementEventListener> statementEventListeners List of statement event listeners. The list is copied on each write, ensuring that it can be safely iterated over even if other threads or the listeners fired in the same thread add or remove listeners. | |
| ClientPooledConnection | back to summary |
|---|---|
| public ClientPooledConnection(BasicClientDataSource ds, LogWriter logWriter, String user, String password) throws SQLException Constructor for non-XA pooled connections. Using standard Java APIs, a CPDS is passed in. Arguments for user/password overrides anything on the data source.
| |
| ClientPooledConnection | back to summary |
|---|---|
| public ClientPooledConnection(BasicClientDataSource ds, LogWriter logWriter, String user, String password, int rmId) throws SQLException Constructor for XA pooled connections only. Using standard Java APIs, a CPDS is passed in. Arguments for user/password overrides anything on the data source.
| |
| addConnectionEventListener | back to summary |
|---|---|
| public synchronized void addConnectionEventListener(ConnectionEventListener listener) Implements javax. Doc from javax. Registers the given event listener so that it will be notified
when an event occurs on this
| |
| addStatementEventListener | back to summary |
|---|---|
| public void addStatementEventListener(StatementEventListener listener) Implements javax. Registers a StatementEventListener with this PooledConnection object. Components that wish to be informed of events associated with the PreparedStatement object created by this PooledConnection like the close or error occurred event can register a StatementEventListener with this PooledConnection object.
| |
| close | back to summary |
|---|---|
| public synchronized void close() throws SQLException Implements javax. Closes the physical connection to the data source and frees all associated resources.
| |
| createLogicalConnection | back to summary |
|---|---|
| private void createLogicalConnection() throws SqlException Creates a new logical connection by performing all the required steps to be able to reuse the physical connection.
| |
| finalize | back to summary |
|---|---|
| protected void finalize() throws Throwable Overrides java. Doc from java. Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
A subclass overrides the
When running in a Java virtual machine in which finalization has been
disabled or removed, the garbage collector will never call
The general contract of
The
The Java programming language does not guarantee which thread will
invoke the
After the
The
Any exception thrown by the
| |
| fireConnectionEventListeners | back to summary |
|---|---|
| private void fireConnectionEventListeners(SqlException exception) Fire all the
| |
| getConnection | back to summary |
|---|---|
| public synchronized Connection getConnection() throws SQLException Implements javax. Creates a logical connection. This is the standard API for getting a logical connection handle for a pooled connection. No "resettable" properties are passed, so user, password, and all other properties may not change.
| |
| informListeners | back to summary |
|---|---|
| public void informListeners(SqlException exception) Inform listeners that an error has occured on the connection, if the error severity is high enough. Not public, but needs to be visible to am.LogicalConnection
| |
| isStatementPoolingEnabled | back to summary |
|---|---|
| public boolean isStatementPoolingEnabled() Tells is statement pooling is enabled or not.
| |
| nullLogicalConnection | back to summary |
|---|---|
| public synchronized void nullLogicalConnection() Used by | |
| onStatementClose | back to summary |
|---|---|
| public void onStatementClose(PreparedStatement statement) Raise the statementClosed event for all the listeners when the corresponding events occurs.
| |
| onStatementErrorOccurred | back to summary |
|---|---|
| public void onStatementErrorOccurred(PreparedStatement statement, SQLException sqle) Raise the statementErrorOccurred event for all the listeners when the corresponding events occurs.
| |
| recycleConnection | back to summary |
|---|---|
| public synchronized void recycleConnection() Inform listeners that the logical connection has been closed and that the physical connection is ready for reuse. Not public, but needs to be visible to am.LogicalConnection | |
| removeConnectionEventListener | back to summary |
|---|---|
| public synchronized void removeConnectionEventListener(ConnectionEventListener listener) Implements javax. Doc from javax. Removes the given event listener from the list of components that
will be notified when an event occurs on this
| |
| removeStatementEventListener | back to summary |
|---|---|
| public void removeStatementEventListener(StatementEventListener listener) Implements javax. Removes the specified previously registered listener object from the list of components that would be informed of events with a PreparedStatement object.
| |