Interface TransactionCallback<T>
public interface TransactionCallback<T>
A simple callback that needs to be provided with an action to run in the doInTransaction method.
It is assumed that if anything goes wrong, doInTransaction will throw a RuntimeException if anything goes
wrong, and the calling transactionTemplate will roll back the transaction.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionRuns an action in a transaction and returns a optional value.
-
Method Details
-
doInTransaction
T doInTransaction()Runs an action in a transaction and returns a optional value.- Returns:
- Optional result of the operation. May be null
- Throws:
RuntimeException- if anything went wrong. The caller will be responsible for rolling back.
-