Class HibernateRunner

java.lang.Object
com.atlassian.bamboo.persistence.HibernateRunner

@ExperimentalApi @Internal public class HibernateRunner extends Object
This class provides a way for background thread to run database related operations without using SAL TransactionTemplate
  • Constructor Details

    • HibernateRunner

      public HibernateRunner()
  • Method Details

    • runWithHibernateSession

      public static <T> T runWithHibernateSession(Callable<T> delegate) throws Exception
      Set hibernate session into ThreadLocal and run the Callable
      Parameters:
      delegate - the callable object to be run
      Returns:
      return value of the callable object
      Throws:
      Exception