org.hibernate.engine.transaction.spi.IsolationDelegate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core Show documentation
Show all versions of hibernate-core Show documentation
The core O/RM functionality as provided by Hibernate
The newest version!
/*
* 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;
}