Interface SQLExceptionHandler

All Known Implementing Classes:
DB2SQLExceptionHandler, DefaultSQLExceptionHandler, MSSQLExceptionHandler, MySQLExceptionHandler

public interface SQLExceptionHandler
Interface to help handle SQLExceptions across different DB implementations
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Query if a given exception signifies a well known error type Allows table handlers to abstract database specific differences in reporting errors.
    boolean
    As whether a given exception should be retried
  • Method Details

    • isErrorType

      boolean isErrorType(SQLException ex, ErrorType errorType)
      Query if a given exception signifies a well known error type Allows table handlers to abstract database specific differences in reporting errors.
      Parameters:
      ex - The exception thrown by the database
      errorType - the error type to test against
      Returns:
      true if the exception matches the error type passed
    • isRetryable

      boolean isRetryable(SQLException ex, Connection connection)
      As whether a given exception should be retried
      Parameters:
      ex - the exception thrown by the database
      connection - where the failure occured, used for additional context
      Returns:
      true if the expectation is that transaction should be retried by the application