PooledConnection
OracleXAConnection
OraclePooledConnection
, OracleXAConnection
, OracleXAConnection
, OracleXAHeteroConnection
public interface OraclePooledConnection extends PooledConnection
PooledConnection
.Modifier and Type | Method | Description |
---|---|---|
CallableStatement |
getCallWithKey(String key) |
Searches the explicit cache for a match on key.
|
boolean |
getExplicitCachingEnabled() |
Checks if explicit cache is currently enabled.
|
boolean |
getImplicitCachingEnabled() |
Checks if implicit cache is currently enabled.
|
long |
getLastAccessedTime() |
Get the last accessed time on the PooledConnection.
|
Connection |
getLogicalHandle() |
Return the logical handle to the caller.
|
int |
getStatementCacheSize() |
Returns the current size of the application cache.
|
PreparedStatement |
getStatementWithKey(String key) |
Searches the explicit cache for a match on key.
|
XAResource |
getXAResource() |
Return an XA resource to the caller.
|
void |
purgeExplicitCache() |
Removes all existing statements from the explicit cache, after which it will be empty.
|
void |
purgeImplicitCache() |
Removes all existing statements from the implicit cache, after which it will be empty.
|
void |
registerCloseCallback(oracle.jdbc.driver.OracleCloseCallback occ, Object privData) |
Registers a close callback.
|
void |
registerImplicitCacheConnectionEventListener(ConnectionEventListener cel) |
Register an event listener for the implicit connection cache.
|
void |
setExplicitCachingEnabled(boolean cache) |
Enables or disables the explicit cache.
|
void |
setImplicitCachingEnabled(boolean cache) |
Enables or disables the implicit cache.
|
void |
setLastAccessedTime(long lastAccessedTime) |
Set the last accessed time on the PooledConnection.
|
void |
setShardingKey(OracleShardingKey shardingKey, OracleShardingKey superShardingKey) |
Sets the sharding key and the super sharding key on this connection.
|
boolean |
setShardingKeyIfValid(OracleShardingKey shardingKey, OracleShardingKey superShardingKey, int timeout) |
Checks the validity of the connection and also checks if the sharding keys passed to this method are valid for the connection.If the sharding keys are valid, it will be set on the connection.
|
void |
setStatementCacheSize(int size) |
Specifies the size of the size of the application cache (which will be used by both implicit and explicit caching).
|
addConnectionEventListener, addStatementEventListener, close, getConnection, removeConnectionEventListener, removeStatementEventListener
Connection getLogicalHandle() throws SQLException
Return the logical handle to the caller. This logical handle refers to the physical connection that is pooled.
SQLException
void setLastAccessedTime(long lastAccessedTime) throws SQLException
Set the last accessed time on the PooledConnection. This is used by the inactivity timeout thread
lastAccessedTime
- last accessed time in millisecondsSQLException
long getLastAccessedTime() throws SQLException
Get the last accessed time on the PooledConnection. This is used by the inactivity timeout thread
SQLException
void registerCloseCallback(oracle.jdbc.driver.OracleCloseCallback occ, Object privData)
Registers a close callback.
occ
- The callback to be registered.privData
- Private data object to be passed to the callback.void registerImplicitCacheConnectionEventListener(ConnectionEventListener cel)
Register an event listener for the implicit connection cache.
cel
- The listener to be registeredvoid setStatementCacheSize(int size) throws SQLException
size
- Requested size of the cache. If the existing cache size is less than size, statements will be purged to reduce the size.SQLException
- if size < 0, or if called on a logical connection.int getStatementCacheSize() throws SQLException
SQLException
void setImplicitCachingEnabled(boolean cache) throws SQLException
cache
- If true, then implicit caching will be enabled. If false, then any existing statements will be purged and the implicit cache will be disabled.SQLException
- if called on a logical connection.boolean getImplicitCachingEnabled() throws SQLException
SQLException
void setExplicitCachingEnabled(boolean cache) throws SQLException
cache
- If true, then explicit caching will be enabled. If false, then any existing statements will be purged and the explicit cache will be disabled.SQLException
- if called on a logical connection.boolean getExplicitCachingEnabled() throws SQLException
SQLException
void purgeImplicitCache() throws SQLException
SQLException
void purgeExplicitCache() throws SQLException
SQLException
PreparedStatement getStatementWithKey(String key) throws SQLException
key
- Specified key to search forSQLException
CallableStatement getCallWithKey(String key) throws SQLException
key
- Specified key to search forSQLException
XAResource getXAResource() throws SQLException
SQLException
- if a database error occursboolean setShardingKeyIfValid(OracleShardingKey shardingKey, OracleShardingKey superShardingKey, int timeout) throws SQLException
shardingKey
- Sharding key to be validated against this connectionsuperShardingKey
- Super Sharding key to be validated against this connectiontimeout
- Time in seconds before which the validation process is expected to be complete, else the validation process is aborted. The value of the timeout must be set to zero to disable the timeout during the validation.SQLException
- if there is any exception while performing this validation or if timeout value is less than 0.void setShardingKey(OracleShardingKey shardingKey, OracleShardingKey superShardingKey) throws SQLException
shardingKey
- sharding key to be set on this connectionsuperShardingKey
- Super Sharding key to be set on this connectionSQLException
- if there is an exception while setting the sharding keys on this connection.