Package org.jdbi.v3.core.transaction
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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturns a copy of this configuration object.setMaxRetries(int maxRetries) Sets the maximum number of retry attempts before aborting.setOnFailure(Consumer<List<Exception>> onFailure) Set a consumer that is called with a list of exceptions during a run.setOnSuccess(Consumer<List<Exception>> onSuccess) Sets a consumer that is called after a run has completed successfully.setSerializationFailureSqlState(String serializationFailureSqlState) Sets the SQL state to consider as a serialization failure.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jdbi.v3.core.config.JdbiConfigsetRegistry
- 
Constructor Details- 
Configurationpublic Configuration()
 
- 
- 
Method Details- 
setMaxRetriesSets the maximum number of retry attempts before aborting.- Parameters:
- maxRetries- The maximum number of retry attempts before aborting.
- Returns:
- this
 
- 
setSerializationFailureSqlStatepublic 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
 
- 
setOnFailurepublic SerializableTransactionRunner.Configuration setOnFailure(Consumer<List<Exception>> onFailure) 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
 
- 
setOnSuccesspublic SerializableTransactionRunner.Configuration setOnSuccess(Consumer<List<Exception>> onSuccess) 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
 
- 
createCopyDescription copied from interface:JdbiConfigReturns a copy of this configuration object. Changes to the copy should not modify the original, and vice-versa.- Specified by:
- createCopyin interface- JdbiConfig<SerializableTransactionRunner.Configuration>
- Returns:
- a copy of this configuration object.
 
 
-