Class HibernateTransaction

java.lang.Object
com.peterphi.std.guice.hibernate.module.HibernateTransaction
All Implemented Interfaces:
AutoCloseable

public class HibernateTransaction extends Object implements AutoCloseable
  • Constructor Details

    • HibernateTransaction

      public HibernateTransaction(org.hibernate.Transaction tx)
  • Method Details

    • withAutoRollback

      public HibernateTransaction withAutoRollback()
      Set the automatic close action to rollback (rather than commit)
      Returns:
    • withAutoCommit

      public HibernateTransaction withAutoCommit()
      Set the automatic close action to commit (rather than rollback)
      Returns:
    • commit

      public void commit()
    • rollback

      public void rollback()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable