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
ConnectionLifecycleListener
onBorrow
in interface ConnectionLifecycleListener
SQLException
public void onRelease(JDBCDataStore store, Connection cx) throws SQLException
ConnectionLifecycleListener
onRelease
in interface ConnectionLifecycleListener
SQLException
public void onCommit(JDBCDataStore store, Connection cx)
ConnectionLifecycleListener
onCommit
in interface ConnectionLifecycleListener
public void onRollback(JDBCDataStore store, Connection cx)
ConnectionLifecycleListener
onRollback
in interface ConnectionLifecycleListener
Copyright © 1996–2022 Geotools. All rights reserved.