Interface Transaction

All Known Implementing Classes:
DefaultTransaction

public interface Transaction
The Transaction API.
Author:
Manfred Riem ([email protected])
  • Method Summary

    Modifier and Type Method Description
    void commit()
    Commit the transaction.
    boolean delistResource​(javax.transaction.xa.XAResource xaResource, int flag)
    Delist the XA resource.
    boolean enlistResource​(javax.transaction.xa.XAResource xaResource)
    Enlist the XA resource.
    int getStatus()
    Get the status.
    void registerSynchronization​(Synchronization synchronization)
    Register the synchronization object.
    void rollback()
    Rollback the transaction.
    void setRollbackOnly()
    Set for rollback only.
  • Method Details

    • commit

      void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, java.lang.SecurityException, java.lang.IllegalStateException, SystemException
      Commit the transaction.
      Throws:
      RollbackException - when the transaction has been rolled back.
      HeuristicMixedException - when part of the transaction has been rolled back.
      HeuristicRollbackException - when all of the transaction has been rolled back.
      java.lang.SecurityException - when it was not allowed to commit.
      java.lang.IllegalStateException - when the transaction is inactive.
      SystemException - when a serious error occurs.
    • delistResource

      boolean delistResource​(javax.transaction.xa.XAResource xaResource, int flag) throws java.lang.IllegalStateException, SystemException
      Delist the XA resource.
      Parameters:
      xaResource - the XA resource.
      flag - the TMxxx flag
      Returns:
      true if de-listed successfully, false otherwise.
      Throws:
      java.lang.IllegalStateException - when the transaction is inactive.
      SystemException - when a serious error occurs.
    • enlistResource

      boolean enlistResource​(javax.transaction.xa.XAResource xaResource) throws RollbackException, java.lang.IllegalStateException, SystemException
      Enlist the XA resource.
      Parameters:
      xaResource - the XA resource.
      Returns:
      true if en-listed successfully, false otherwise.
      Throws:
      RollbackException - when the transaction has been marked for rollback.
      java.lang.IllegalStateException - when the transaction is inactive.
      SystemException - when a serious error occurs.
    • getStatus

      int getStatus() throws SystemException
      Get the status.
      Returns:
      the status of the transaction.
      Throws:
      SystemException - when a serious error occurs.
    • registerSynchronization

      void registerSynchronization​(Synchronization synchronization) throws RollbackException, java.lang.IllegalStateException, SystemException
      Register the synchronization object.
      Parameters:
      synchronization - the synchronization object.
      Throws:
      RollbackException - when the transaction has been marked for rollback.
      java.lang.IllegalStateException - when the transaction is inactive.
      SystemException - when a serious error occurs.
    • rollback

      void rollback() throws java.lang.IllegalStateException, SystemException
      Rollback the transaction.
      Throws:
      java.lang.IllegalStateException - when the transaction is inactive.
      SystemException - when a serious error occurs.
    • setRollbackOnly

      void setRollbackOnly() throws java.lang.IllegalStateException, SystemException
      Set for rollback only.
      Throws:
      java.lang.IllegalStateException - when the transaction is inactive.
      SystemException - when a serious error occurs.