Class PostgresSqlQueryExceptionHandler
- java.lang.Object
-
- com.feedzai.commons.sql.abstraction.engine.handler.QueryExceptionHandler
-
- com.feedzai.commons.sql.abstraction.engine.impl.postgresql.PostgresSqlQueryExceptionHandler
-
public class PostgresSqlQueryExceptionHandler extends QueryExceptionHandler
A specific implementation ofQueryExceptionHandlerfor PostgreSQL engine.- Since:
- 2.5.1
- Author:
- José Fidalgo (jose.fidalgo@feedzai.com)
-
-
Constructor Summary
Constructors Constructor Description PostgresSqlQueryExceptionHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisRetryableException(SQLException exception)Checks if an Exception occurred due to serialization failures in concurrent transactions and may be retried on the client-side.booleanisTimeoutException(SQLException exception)Indicates if a given exception is a timeout.-
Methods inherited from class com.feedzai.commons.sql.abstraction.engine.handler.QueryExceptionHandler
handleException
-
-
-
-
Method Detail
-
isTimeoutException
public boolean isTimeoutException(SQLException exception)
Description copied from class:QueryExceptionHandlerIndicates if a given exception is a timeout. Logic for this may be driver-specific, so drivers that support query timeouts may have to override this method. A timeout exception can also be considered retryable.- Overrides:
isTimeoutExceptionin classQueryExceptionHandler- Parameters:
exception- The exception to check.- Returns:
trueif the exception is a timeout,falseotherwise.
-
isRetryableException
public boolean isRetryableException(SQLException exception)
Description copied from class:QueryExceptionHandlerChecks if an Exception occurred due to serialization failures in concurrent transactions and may be retried on the client-side.- Overrides:
isRetryableExceptionin classQueryExceptionHandler- Parameters:
exception- The exception to check.- Returns:
trueif the exception is retryable,falseotherwise.
-
-