public class SessionCommandsListener extends Object implements ConnectionLifecycleListener
ConnectionLifecycleListener that executes custom SQL commands on connection grab and
release. The SQL commands can contain environment variable references, where the environment
variable reference contains a name and an eventual default value.
Parsing rules are:
${ and } is considered a environment variable
reference in the form ${name,defaultvalue}, the default value being optional$ and } can be used stand alone only escaped with \
(e.g. \$ and \})\ can be used stand alone only escaped with another \\\)
} is reserved, should have been escaped)| Constructor and Description |
|---|
SessionCommandsListener(String sqlOnBorrow,
String sqlOnRelease) |
| Modifier and Type | Method and Description |
|---|---|
void |
onBorrow(JDBCDataStore store,
Connection cx)
Called when the collection is being borrowed from the connection pool
|
void |
onCommit(JDBCDataStore store,
Connection cx)
Called when the connection comes to a commit
|
void |
onRelease(JDBCDataStore store,
Connection cx)
Called when the collection is being released back to the connection pool
|
void |
onRollback(JDBCDataStore store,
Connection cx)
Called when the connection comes to a rollback
|
public void onBorrow(JDBCDataStore store, Connection cx) throws SQLException
ConnectionLifecycleListeneronBorrow in interface ConnectionLifecycleListenerSQLExceptionpublic void onRelease(JDBCDataStore store, Connection cx) throws SQLException
ConnectionLifecycleListeneronRelease in interface ConnectionLifecycleListenerSQLExceptionpublic void onCommit(JDBCDataStore store, Connection cx)
ConnectionLifecycleListeneronCommit in interface ConnectionLifecycleListenerpublic void onRollback(JDBCDataStore store, Connection cx)
ConnectionLifecycleListeneronRollback in interface ConnectionLifecycleListenerCopyright © 1996–2021 Geotools. All rights reserved.