Class SerializableTransactionRunner.Configuration

java.lang.Object
org.jdbi.v3.core.transaction.SerializableTransactionRunner.Configuration
All Implemented Interfaces:
JdbiConfig<SerializableTransactionRunner.Configuration>
Enclosing class:
SerializableTransactionRunner

public static class SerializableTransactionRunner.Configuration extends Object implements JdbiConfig<SerializableTransactionRunner.Configuration>
Configuration for serializable transaction runner.
  • Constructor Details Link icon

    • Configuration Link icon

      public Configuration()
  • Method Details Link icon

    • setMaxRetries Link icon

      public SerializableTransactionRunner.Configuration setMaxRetries(int maxRetries)
      Sets the maximum number of retry attempts before aborting.
      Parameters:
      maxRetries - The maximum number of retry attempts before aborting.
      Returns:
      this
    • setSerializationFailureSqlState Link icon

      public SerializableTransactionRunner.Configuration setSerializationFailureSqlState(String serializationFailureSqlState)
      Sets the SQL state to consider as a serialization failure.
      Parameters:
      serializationFailureSqlState - the SQL state to consider as a serialization failure.
      Returns:
      this
    • setOnFailure Link icon

      Set a consumer that is called with a list of exceptions during a run. Will not be called with any exceptions that are not the configured serialization failure. These will simply be thrown, aborting the operation. Can be used e.g. for logging.
      Parameters:
      onFailure - A consumer to handle failures. Will never be called with Exceptions that have not been configured.
      Returns:
      this
    • setOnSuccess Link icon

      Sets a consumer that is called after a run has completed successfully. The consumer will received any exceptions that happened during the run. Will not be called with any exceptions that are not the configured serialization failure. This can be used to e.g. log all exceptions after a successful run.
      Parameters:
      onSuccess - A consumer to handle the list of failures after the run has been completed successfully.
      Returns:
      this
    • createCopy Link icon

      Description copied from interface: JdbiConfig
      Returns a copy of this configuration object. Changes to the copy should not modify the original, and vice-versa.
      Specified by:
      createCopy in interface JdbiConfig<SerializableTransactionRunner.Configuration>
      Returns:
      a copy of this configuration object.