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

com.transferwise.common.baseutils.transactionsmanagement.ITransactionsHelper Maven / Gradle / Ivy

package com.transferwise.common.baseutils.transactionsmanagement;

import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;

import java.util.concurrent.Callable;

/**
 * We will not follow old J2EE logic about RuntimeExceptions vs CheckedExceptions and rollback on any exception.
 */
public interface ITransactionsHelper {
	boolean isRollbackOnly();

	void markAsRollbackOnly();

	IBuilder withTransaction();

    interface IBuilder {
        IBuilder withPropagation(Propagation propagation);

        IBuilder asNew();

        IBuilder asSuspended();

        IBuilder asReadOnly();

        IBuilder asReadOnly(boolean readOnly);

        IBuilder withName(String name);

        IBuilder withIsolation(Isolation isolation);

        IBuilder withTimeout(Integer timeout);

         T call(Callable callable);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy