com.mysql.jdbc
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
 void close()
          Called when an application calls Connection.close(), before the driver processes its own internal logic for close.
 boolean commit()
          Called when an application calls Connection.commit(), before the driver processes its own internal logic for commit().
 boolean rollback()
          Called when an application calls Connection.rollback(), before the driver processes its own internal logic for rollback().
 boolean rollback(java.sql.Savepoint s)
          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(java.lang.String catalog)
          Called when an application calls Connection.setCatalog(), before the driver processes its own internal logic for setCatalog().
 boolean 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).
 boolean transactionCompleted()
          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 com.mysql.jdbc.Extension
destroy, init
 

Method Detail

close

void close()
           throws java.sql.SQLException
Called when an application calls Connection.close(), before the driver processes its own internal logic for close.

Throws:
java.sql.SQLException

commit

boolean commit()
               throws java.sql.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:
java.sql.SQLException - if an error occurs

rollback

boolean rollback()
                 throws java.sql.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:
java.sql.SQLException - if an error occurs

rollback

boolean rollback(java.sql.Savepoint s)
                 throws java.sql.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:
java.sql.SQLException - if an error occurs

setAutoCommit

boolean setAutoCommit(boolean flag)
                      throws java.sql.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:
java.sql.SQLException - if an error occurs

setCatalog

boolean setCatalog(java.lang.String catalog)
                   throws java.sql.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:
java.sql.SQLException - if an error occurs

transactionBegun

boolean transactionBegun()
                         throws java.sql.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:
java.sql.SQLException

transactionCompleted

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

Throws:
java.sql.SQLException