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

    • Configuration

      public Configuration()
  • Method Details

    • setMaxRetries

      public SerializableTransactionRunner.Configuration setMaxRetries(int maxRetries)
      Parameters:
      maxRetries - number of retry attempts before aborting
      Returns:
      this
    • setSerializationFailureSqlState

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

      Parameters:
      onFailure - consumer to handle the list of failures so far (e.g. for logging). Will not be called with an empty list, nor with any exceptions that are not the configured serialization failure — the latter will simply be thrown, aborting the operation.
      Returns:
      this
    • setOnSuccess

      Parameters:
      onSuccess - consumer to handle the list of failures that occurred during a transaction run, after the run has completed successfully (e.g. for logging). Will hopefully be called with an empty list, but with the same list of exceptions as the one passed to onFailure otherwise. Will not be called with any exceptions that are not the configured serialization failure — the latter will simply be thrown, aborting the operation.
      Returns:
      this
    • createCopy

      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.