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

org.hibernate.engine.transaction.spi.IsolationDelegate Maven / Gradle / Ivy

/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
 * See the lgpl.txt file in the root directory or .
 */
package org.hibernate.engine.transaction.spi;

import org.hibernate.HibernateException;
import org.hibernate.jdbc.WorkExecutorVisitable;

import java.util.concurrent.Callable;

/**
 * Contract for performing work in a manner that isolates it from any current transaction.
 *
 * @author Steve Ebersole
 */
public interface IsolationDelegate {
	/**
	 * Perform the given work in isolation from current transaction.
	 *
	 * @param work The work to be performed.
	 * @param transacted Should the work itself be done in a (isolated) transaction?
	 *
	 * @return The work result
	 *
	 * @throws HibernateException Indicates a problem performing the work.
	 */
	public  T delegateWork(WorkExecutorVisitable work, boolean transacted) throws HibernateException;

	/**
	 * Invoke the given callable in isolation from current transaction.
	 *
	 * @param callable The callable to be invoked.
	 * @param transacted Should the work itself be done in a (isolated) transaction?
	 *
	 * @return The work result
	 *
	 * @throws HibernateException Indicates a problem performing the work.
	 */
	public  T delegateCallable(Callable callable, boolean transacted) throws HibernateException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy