Interface TransactionControl

All Superinterfaces:
TransactionStarter

@ProviderType public interface TransactionControl extends TransactionStarter
The interface used by clients to control the active transaction context
  • Method Details

    • build

      Build a transaction context to surround a piece of transactional work
      Returns:
      A builder to complete the creation of the transaction
    • activeTransaction

      boolean activeTransaction()
      Returns:
      true if a transaction is currently active
    • activeScope

      boolean activeScope()
      Returns:
      true if a transaction is currently active, or if there is a "no transaction" context active
    • getCurrentContext

      TransactionContext getCurrentContext()
      Returns:
      The current transaction context, which may be a "no transaction" context, or null if there is no active context
    • getRollbackOnly

      boolean getRollbackOnly() throws IllegalStateException
      Gets the rollback status of the active transaction
      Returns:
      true if the transaction is marked for rollback
      Throws:
      IllegalStateException - if no transaction is active
    • setRollbackOnly

      void setRollbackOnly() throws IllegalStateException
      Marks the current transaction to be rolled back
      Throws:
      IllegalStateException - if no transaction is active
    • ignoreException

      void ignoreException(Throwable t) throws IllegalStateException
      Marks that the current transaction should not be rolled back if the supplied Exception is thrown by the current transactional work
      Parameters:
      t - The exception to ignore
      Throws:
      IllegalStateException - if no transaction is active