Interface ConnectionLifecycleInterceptor
- All Superinterfaces:
Extension
Implementors of this interface can be installed via the "connectionLifecycleInterceptors" configuration property and receive events and alter behavior of
"lifecycle" methods on our connection implementation.
The driver will create one instance of a given interceptor per-connection.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Called when an application calls Connection.close(), before the driver processes its own internal logic for close.booleancommit()Called when an application calls Connection.commit(), before the driver processes its own internal logic for commit().booleanrollback()Called when an application calls Connection.rollback(), before the driver processes its own internal logic for rollback().booleanCalled when an application calls Connection.rollback(), before the driver processes its own internal logic for rollback().booleansetAutoCommit(boolean flag) Called when an application calls Connection.setAutoCommit(), before the driver processes its own internal logic for setAutoCommit().booleansetCatalog(String catalog) Called when an application calls Connection.setCatalog(), before the driver processes its own internal logic for setCatalog().booleanCalled when the driver has been told by the server that a transaction is now in progress (when one has not been currently in progress).booleanCalled when the driver has been told by the server that a transaction has completed, and no transaction is currently in progress.
-
Method Details
-
close
Called when an application calls Connection.close(), before the driver processes its own internal logic for close.- Throws:
SQLException
-
commit
Called when an application calls Connection.commit(), before the driver processes its own internal logic for commit(). Interceptors should return "true" if the driver should perform its own internal logic for commit(), or "false" if not.- Returns:
- "true" if the driver should perform its own internal logic for commit(), or "false" if not.
- Throws:
SQLException- if an error occurs
-
rollback
Called when an application calls Connection.rollback(), before the driver processes its own internal logic for rollback(). Interceptors should return "true" if the driver should perform its own internal logic for rollback(), or "false" if not.- Returns:
- "true" if the driver should perform its own internal logic for rollback(), or "false" if not.
- Throws:
SQLException- if an error occurs
-
rollback
Called when an application calls Connection.rollback(), before the driver processes its own internal logic for rollback(). Interceptors should return "true" if the driver should perform its own internal logic for rollback(), or "false" if not.- Returns:
- "true" if the driver should perform its own internal logic for rollback(), or "false" if not.
- Throws:
SQLException- if an error occurs
-
setAutoCommit
Called when an application calls Connection.setAutoCommit(), before the driver processes its own internal logic for setAutoCommit(). Interceptors should return "true" if the driver should perform its own internal logic for setAutoCommit(), or "false" if not.- Returns:
- "true" if the driver should perform its own internal logic for setAutoCommit(), or "false" if not.
- Throws:
SQLException- if an error occurs
-
setCatalog
Called when an application calls Connection.setCatalog(), before the driver processes its own internal logic for setCatalog(). Interceptors should return "true" if the driver should perform its own internal logic for setCatalog(), or "false" if not.- Returns:
- "true" if the driver should perform its own internal logic for setCatalog(), or "false" if not.
- Throws:
SQLException- if an error occurs
-
transactionBegun
Called when the driver has been told by the server that a transaction is now in progress (when one has not been currently in progress).- Throws:
SQLException
-
transactionCompleted
Called when the driver has been told by the server that a transaction has completed, and no transaction is currently in progress.- Throws:
SQLException
-