All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ee.bitweb.core.persistence.TransactionHelper Maven / Gradle / Ivy

The newest version!
package ee.bitweb.core.persistence;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;

@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class TransactionHelper {

    public static void afterCommit(Runnable runnable) {
        TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
            @Override
            public void afterCommit() {
                runnable.run();
            }
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy