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

nl.vpro.services.TransactionService Maven / Gradle / Ivy

Go to download

Several domains like 'media', pages' and 'subtitles' in the POMS system share some common properties which are collected here

There is a newer version: 8.3.1
Show newest version
package nl.vpro.services;

import java.util.concurrent.Callable;
import java.util.function.*;

import org.checkerframework.checker.nullness.qual.NonNull;
import org.meeuw.functional.ThrowAnyRunnable;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * Please note that transactions are only rolled back in case of a runtime exception
 * 

* Also note that in new transactions the currently existing hibernate filters will be gone. * * @author Danny Sedney */ public interface TransactionService { /** * Run callable in new transaction. Transaction is rolled back ONLY in case of a runtime exception * @param callable The jobs to be processed in the new transaction * @return The result of the callable * @throws Exception The exception thrown by the callable */ T executeInNewTransaction(@NonNull Callable callable) throws Exception; T getInNewTransaction(@NonNull Supplier supplier); T getInTransaction(@NonNull Supplier supplier); void executeInNewTransaction(@NonNull Runnable runnable); T executeInNewTransaction(S argument, @NonNull Function function); void executeInNewTransaction(T argument,@NonNull Consumer consumer); T executeInReadonlyTransaction(@NonNull Callable callable) throws Exception; T getInReadonlyTransaction(@NonNull Supplier supplier); void executeInReadonlyTransaction(@NonNull ThrowAnyRunnable runnable); void executeInReadonlyTransaction(@NonNull Runnable runnable); T executeInReadonlyTransaction(S argument, @NonNull Function function); void executeInReadonlyTransaction(T argument, @NonNull Consumer consumer); @Transactional(propagation = Propagation.NEVER) default void ensureNoTransaction() { } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy