クラス TransactionContextManager
java.lang.ObjectSE
org.springframework.transaction.reactive.TransactionContextManager
 トランザクションコンテキストを登録および取得するためのデリゲート。
通常、AOP インターセプターやトランザクションオペレーターなどのトランザクションフローをインターセプトまたは調整するコンポーネントによって使用されます。
- 導入:
- 5.2
- 作成者:
- Mark Paluch
- 関連事項:
- メソッドのサマリー修飾子と型メソッド説明- static FunctionSE<reactor.util.context.Context,- reactor.util.context.Context> - TransactionContextを作成し、サブスクライバー- Contextに登録します。- static reactor.core.publisher.Mono<TransactionContext>サブスクライバーコンテキストまたはトランザクションコンテキストホルダーから現在の- TransactionContextを取得します。- static FunctionSE<reactor.util.context.Context,- reactor.util.context.Context> - FunctionSE を返し、新しい- TransactionContextを作成または関連付けます。- static FunctionSE<reactor.util.context.Context,- reactor.util.context.Context> - FunctionSE を返し、新しい- TransactionContextHolderを作成または関連付けます。
- メソッドの詳細- currentContextサブスクライバーコンテキストまたはトランザクションコンテキストホルダーから現在の- TransactionContextを取得します。コンテキストまたはコンテキストホルダーが登録されていない場合、コンテキストの取得は NoTransactionException で失敗します。- 戻り値:
-  現在の TransactionContext
- 例外:
- NoTransactionException- サブスクライバーコンテキストで TransactionContext が見つからなかった場合、またはホルダーでコンテキストが見つからなかった場合
 
- createTransactionContextpublic static FunctionSE<reactor.util.context.Context,- reactor.util.context.Context> createTransactionContext()- TransactionContextを作成し、サブスクライバー- Contextに登録します。- 戻り値:
- 関数コンテキスト登録。
- 例外:
- IllegalStateExceptionSE- トランザクションコンテキストがすでに関連付けられている場合。
- 関連事項:
- Mono.contextWrite(Function)
- Flux.contextWrite(Function)
 
 
- getOrCreateContextpublic static FunctionSE<reactor.util.context.Context,- reactor.util.context.Context> getOrCreateContext()- FunctionSE を返し、新しい- TransactionContextを作成または関連付けます。- TransactionSynchronizationManagerを介したトランザクションリソースとの対話には、TransactionContext をサブスクライバーコンテキストに登録する必要があります。- 戻り値:
- 関数コンテキスト登録。
 
- getOrCreateContextHolderpublic static FunctionSE<reactor.util.context.Context,- reactor.util.context.Context> getOrCreateContextHolder()- FunctionSE を返し、新しい- TransactionContextHolderを作成または関連付けます。リアクティブフロー内でトランザクションを作成および解放するには、トップツーダウンの実行スキームに従う可変ホルダーが必要です。Reactor のサブスクライバーコンテキストは、ミューテーションの可視性に関するトップツーアプローチに従います。- 戻り値:
- 関数コンテキスト登録。