Package migratedb.v1.core.internal.jdbc
Class TransactionalExecutionTemplate
java.lang.Object
migratedb.v1.core.internal.jdbc.TransactionalExecutionTemplate
- All Implemented Interfaces:
ExecutionTemplate
- Direct Known Subclasses:
CockroachRetryingTransactionalExecutionTemplate
Spring-like template for executing transactions.
-
Constructor Summary
ConstructorsConstructorDescriptionTransactionalExecutionTemplate(Connection connection, boolean rollbackOnException) Creates a new transaction template for this connection. -
Method Summary
-
Constructor Details
-
TransactionalExecutionTemplate
Creates a new transaction template for this connection.- Parameters:
connection- The connection for the transaction.rollbackOnException- Whether to roll back the transaction when an exception is thrown.
-
-
Method Details
-
execute
Executes this callback within a transaction.- Specified by:
executein interfaceExecutionTemplate- Parameters:
callback- The callback to execute.- Returns:
- The result of the transaction code.
-