Class TransactionSynchronizationUtils
java.lang.Object
org.springframework.transaction.support.TransactionSynchronizationUtils
Utility methods for triggering specific 
TransactionSynchronization
 callback methods on all currently registered synchronizations.- Since:
- 2.0
- Author:
- Juergen Hoeller
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidinvokeAfterCommit(List<TransactionSynchronization> synchronizations) Actually invoke theafterCommitmethods of the given Spring TransactionSynchronization objects.static voidinvokeAfterCompletion(List<TransactionSynchronization> synchronizations, int completionStatus) Actually invoke theafterCompletionmethods of the given Spring TransactionSynchronization objects.static booleansameResourceFactory(ResourceTransactionManager tm, Object resourceFactory) Check whether the given resource transaction manager refers to the given (underlying) resource factory.static voidTriggerafterCommitcallbacks on all currently registered synchronizations.static voidtriggerAfterCompletion(int completionStatus) TriggerafterCompletioncallbacks on all currently registered synchronizations.static voidtriggerBeforeCommit(boolean readOnly) TriggerbeforeCommitcallbacks on all currently registered synchronizations.static voidTriggerbeforeCompletioncallbacks on all currently registered synchronizations.static voidTriggerflushcallbacks on all currently registered synchronizations.static ObjectunwrapResourceIfNecessary(Object resource) Unwrap the given resource handle if necessary; otherwise return the given handle as-is.
- 
Constructor Details- 
TransactionSynchronizationUtilspublic TransactionSynchronizationUtils()
 
- 
- 
Method Details- 
sameResourceFactoryCheck whether the given resource transaction manager refers to the given (underlying) resource factory.
- 
unwrapResourceIfNecessaryUnwrap the given resource handle if necessary; otherwise return the given handle as-is.- Since:
- 5.3.4
- See Also:
 
- 
triggerFlushpublic static void triggerFlush()Triggerflushcallbacks on all currently registered synchronizations.- Throws:
- RuntimeException- if thrown by a- flushcallback
- See Also:
 
- 
triggerBeforeCommitpublic static void triggerBeforeCommit(boolean readOnly) TriggerbeforeCommitcallbacks on all currently registered synchronizations.- Parameters:
- readOnly- whether the transaction is defined as read-only transaction
- Throws:
- RuntimeException- if thrown by a- beforeCommitcallback
- See Also:
 
- 
triggerBeforeCompletionpublic static void triggerBeforeCompletion()TriggerbeforeCompletioncallbacks on all currently registered synchronizations.
- 
triggerAfterCommitpublic static void triggerAfterCommit()TriggerafterCommitcallbacks on all currently registered synchronizations.- Throws:
- RuntimeException- if thrown by a- afterCommitcallback
- See Also:
 
- 
invokeAfterCommitActually invoke theafterCommitmethods of the given Spring TransactionSynchronization objects.- Parameters:
- synchronizations- a List of TransactionSynchronization objects
- See Also:
 
- 
triggerAfterCompletionpublic static void triggerAfterCompletion(int completionStatus) TriggerafterCompletioncallbacks on all currently registered synchronizations.- Parameters:
- completionStatus- the completion status according to the constants in the TransactionSynchronization interface
- See Also:
 
- 
invokeAfterCompletionpublic static void invokeAfterCompletion(@Nullable List<TransactionSynchronization> synchronizations, int completionStatus) Actually invoke theafterCompletionmethods of the given Spring TransactionSynchronization objects.- Parameters:
- synchronizations- a List of TransactionSynchronization objects
- completionStatus- the completion status according to the constants in the TransactionSynchronization interface
- See Also:
 
 
-