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

no.ssb.lds.api.persistence.TransactionFactory Maven / Gradle / Ivy

There is a newer version: 0.13
Show newest version
package no.ssb.lds.api.persistence;

import java.util.concurrent.CompletableFuture;
import java.util.function.Function;

public interface TransactionFactory {

     CompletableFuture runAsyncInIsolatedTransaction(Function> retryable);

    /**
     * Create a new transaction.
     *
     * @param readOnly true if the transaction will only perform read operations, false if at least one write operation
     *                 will be performed, and false if the caller is unsure. Note that the underlying persistence
     *                 provider may be able to optimize performance and contention related issues when read-only
     *                 transactions are involved.
     * @return the newly created transaction
     * @throws PersistenceException
     */
    Transaction createTransaction(boolean readOnly) throws PersistenceException;

    void close();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy