|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.firebirdsql.pool.AbstractPingablePooledConnection
public abstract class AbstractPingablePooledConnection
This class implements PooledConnection interface.
| Field Summary | |
|---|---|
protected Connection |
jdbcConnection
|
| Constructor Summary | |
|---|---|
protected |
AbstractPingablePooledConnection(Connection connection,
boolean statementPooling,
int maxStatements,
boolean keepStatements)
|
protected |
AbstractPingablePooledConnection(Connection connection,
String pingStatement,
int pingInterval,
boolean statementPooling,
int maxStatements,
boolean keepStatements)
|
| Method Summary | |
|---|---|
void |
addConnectionEventListener(ConnectionEventListener listener)
Add connection listener to be notified about connection events. |
void |
close()
Close this pooled connection. |
protected void |
configureConnectionDefaults(Connection connection)
Configure default values for this connection. |
void |
connectionClosed(org.firebirdsql.pool.PooledConnectionHandler connection)
Notify connection owner about invocation of the Connection.close()
operation on PooledConnectionHandler instance. |
void |
connectionCommitted(org.firebirdsql.pool.PooledConnectionHandler connection)
Notify this class that transaction was committed. |
void |
connectionErrorOccured(org.firebirdsql.pool.PooledConnectionHandler connection,
SQLException ex)
Notify connection owner about the SQLException that happened
during method invocation on the wrapped connection. |
void |
connectionRolledBack(org.firebirdsql.pool.PooledConnectionHandler connection)
Notify this class that transaction was rolled back. |
void |
deallocate()
Deallocate this object. |
Connection |
getConnection()
Get JDBC connection corresponding to this pooled connection instance. |
long |
getLastPingTime()
Get the time when connection was pinged last time. |
protected Logger |
getLogChannel()
|
PreparedStatement |
getPreparedStatement(String statement,
int resultSetType,
int resultSetConcurrency)
Handle Connection.prepareStatement(String) method call. |
protected void |
internalClose()
Close this connection. |
boolean |
isInPool()
Check whether this object is currently in pool or had been released to the application. |
boolean |
isKeepStatements()
|
boolean |
isStatementPooling()
|
boolean |
isValid()
Check if this pooled connection is still valid. |
boolean |
isValid(org.firebirdsql.pool.PooledConnectionHandler connection)
Check if specified connection is still valid. |
boolean |
ping()
Ping connection by executing a ping statement. |
org.firebirdsql.pool.XCachablePreparedStatement |
prepareStatement(String statement,
int resultSetType,
int resultSetConcurrency,
boolean cached)
Prepare the specified statement and wrap it with cache notification wrapper. |
void |
removeConnectionEventListener(ConnectionEventListener listener)
Remove connection listener from this pooled connection. |
void |
setDefaultTransactionIsolation(int isolation)
|
void |
setInPool(boolean inPool)
Set the "inPool" flag to this object. |
void |
statementClosed(String statement,
Object proxy)
Handle Statement.close() method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.sql.PooledConnection |
|---|
addStatementEventListener, removeStatementEventListener |
| Field Detail |
|---|
protected Connection jdbcConnection
| Constructor Detail |
|---|
protected AbstractPingablePooledConnection(Connection connection,
boolean statementPooling,
int maxStatements,
boolean keepStatements)
throws SQLException
SQLException
protected AbstractPingablePooledConnection(Connection connection,
String pingStatement,
int pingInterval,
boolean statementPooling,
int maxStatements,
boolean keepStatements)
throws SQLException
SQLException| Method Detail |
|---|
protected Logger getLogChannel()
public void setDefaultTransactionIsolation(int isolation)
public long getLastPingTime()
public boolean isStatementPooling()
public boolean isKeepStatements()
public boolean ping()
true if connection was successfully pinged.public boolean isValid()
isValid in interface PooledObjecttrue if this pooled connection is still valid.public boolean isInPool()
isInPool in interface PooledObjecttrue if the object is currently in pool.public void setInPool(boolean inPool)
setInPool in interface PooledObjectinPool - true if object is in pool, otherwise
false.public void addConnectionEventListener(ConnectionEventListener listener)
addConnectionEventListener in interface PooledConnectionlistener - listener to add.public void removeConnectionEventListener(ConnectionEventListener listener)
removeConnectionEventListener in interface PooledConnectionlistener - listener to remove.
public void close()
throws SQLException
close in interface PooledConnectionSQLException
protected void internalClose()
throws SQLException
SQLException - if something went wrong.public void deallocate()
deallocate in interface PooledObject
public Connection getConnection()
throws SQLException
getConnection in interface PooledConnectionConnection
SQLException - if some error happened.
protected void configureConnectionDefaults(Connection connection)
throws SQLException
connection - instance of Connection to configure.
SQLException - if something went wrong.
public PreparedStatement getPreparedStatement(String statement,
int resultSetType,
int resultSetConcurrency)
throws SQLException
Connection.prepareStatement(String) method call. This
method check internal cache first and returns prepared statement if found.
Otherwise, it prepares statement and caches it.
statement - statement to prepare.resultSetType - type of the result set.resultSetConcurrency - result set concurrency.
PreparedStatement corresponding to the
statement.
SQLException - if there was problem preparing statement.
public org.firebirdsql.pool.XCachablePreparedStatement prepareStatement(String statement,
int resultSetType,
int resultSetConcurrency,
boolean cached)
throws SQLException
prepareStatement in interface XStatementManagerstatement - sattement to prepare.resultSetType - type of result setresultSetConcurrency - result set concurrencycached - true if prepared statement will be cached.
SQLException - if underlying connection threw this exception.Connection.prepareStatement(java.lang.String, int, int)
public void statementClosed(String statement,
Object proxy)
throws SQLException
Statement.close() method. This implementation
dereferences proxy in cache.
statementClosed in interface XStatementManagerstatement - SQL statement corresponding to the proxy.proxy - proxy wrapping the connection.
SQLException - if prepared statement cannot be added to the pool.
public void connectionClosed(org.firebirdsql.pool.PooledConnectionHandler connection)
throws SQLException
Connection.close()
operation on PooledConnectionHandler instance.
connection - instance of PooledConnectionHandler that
initiated the call.
SQLException
public void connectionErrorOccured(org.firebirdsql.pool.PooledConnectionHandler connection,
SQLException ex)
SQLException that happened
during method invocation on the wrapped connection.
connection - instance of PooledConnectionHandler that
catched exception.ex - instance of SQLException that was thrown.public boolean isValid(org.firebirdsql.pool.PooledConnectionHandler connection)
connection - instance of PooledConnectionHandler to check.
true if connection owner is still valid,
false otherwise.
public void connectionCommitted(org.firebirdsql.pool.PooledConnectionHandler connection)
throws SQLException
connection - connection that was commited.
SQLExceptionXConnectionManager.connectionCommitted(PooledConnectionHandler)
public void connectionRolledBack(org.firebirdsql.pool.PooledConnectionHandler connection)
throws SQLException
connection - connection that was commited.
SQLExceptionXConnectionManager.connectionRolledBack(PooledConnectionHandler)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||