Example usage for org.springframework.transaction.support TransactionSynchronization beforeCommit

List of usage examples for org.springframework.transaction.support TransactionSynchronization beforeCommit

Introduction

In this page you can find the example usage for org.springframework.transaction.support TransactionSynchronization beforeCommit.

Prototype

default void beforeCommit(boolean readOnly) 

Source Link

Document

Invoked before transaction commit (before "beforeCompletion").

Usage

From source file:org.springframework.transaction.support.TransactionSynchronizationUtils.java

/**
 * Trigger {@code beforeCommit} callbacks on all currently registered synchronizations.
 * @param readOnly whether the transaction is defined as read-only transaction
 * @throws RuntimeException if thrown by a {@code beforeCommit} callback
 * @see TransactionSynchronization#beforeCommit(boolean)
 *//*from ww  w  . jav  a  2 s .  co  m*/
public static void triggerBeforeCommit(boolean readOnly) {
    for (TransactionSynchronization synchronization : TransactionSynchronizationManager.getSynchronizations()) {
        synchronization.beforeCommit(readOnly);
    }
}