接口 TransactionCallback<T>
- 类型参数:
T
- the result type
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
@FunctionalInterface public interface TransactionCallback<T>
Callback interface for reactive transactional code. Used withTransactionalOperator
'sexecute
method, often as anonymous class within a method implementation.Typically used to assemble various calls to transaction-unaware data access services into a higher-level service method with transaction demarcation. As an alternative, consider the use of declarative transaction demarcation (e.g. through Spring's
Transactional
annotation).- 从以下版本开始:
- 5.2
- 作者:
- Mark Paluch, Juergen Hoeller
- 另请参阅:
TransactionalOperator
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 org.reactivestreams.Publisher<T>
doInTransaction(ReactiveTransaction status)
Gets called byTransactionalOperator
within a transactional context.
方法详细资料
doInTransaction
org.reactivestreams.Publisher<T> doInTransaction(ReactiveTransaction status)
Gets called byTransactionalOperator
within a transactional context. Does not need to care about transactions itself, although it can retrieve and influence the status of the current transaction via the given status object, e.g. setting rollback-only.- 参数:
status
- associated transaction status- 返回:
- a result publisher
- 另请参阅:
TransactionalOperator.transactional(reactor.core.publisher.Flux<T>)