Interface ConnectionLifecycleInterceptor

All Superinterfaces:
Extension

public interface ConnectionLifecycleInterceptor extends 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 Type
    Method
    Description
    void
    Called when an application calls Connection.close(), before the driver processes its own internal logic for close.
    boolean
    Called when an application calls Connection.commit(), before the driver processes its own internal logic for commit().
    boolean
    Called when an application calls Connection.rollback(), before the driver processes its own internal logic for rollback().
    boolean
    Called when an application calls Connection.rollback(), before the driver processes its own internal logic for rollback().
    boolean
    setAutoCommit(boolean flag)
    Called when an application calls Connection.setAutoCommit(), before the driver processes its own internal logic for setAutoCommit().
    boolean
    setCatalog(String catalog)
    Called when an application calls Connection.setCatalog(), before the driver processes its own internal logic for setCatalog().
    boolean
    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).
    boolean
    Called when the driver has been told by the server that a transaction has completed, and no transaction is currently in progress.

    Methods inherited from interface Extension

    destroy, init
  • Method Details

    • close

      void close() throws SQLException
      Called when an application calls Connection.close(), before the driver processes its own internal logic for close.
      Throws:
      SQLException
    • commit

      boolean commit() throws SQLException
      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

      boolean rollback() throws SQLException
      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

      boolean rollback(Savepoint s) throws SQLException
      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

      boolean setAutoCommit(boolean flag) throws SQLException
      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

      boolean setCatalog(String catalog) throws SQLException
      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

      boolean transactionBegun() throws SQLException
      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

      boolean transactionCompleted() throws SQLException
      Called when the driver has been told by the server that a transaction has completed, and no transaction is currently in progress.
      Throws:
      SQLException