Interface Transaction


public interface Transaction

OsidTransaction is used by an OsidSession to provide transactions across its methods. Transactions are performed within a session. Coordination of transactions across OSIDS of there sessions requires the availability of a transaction manager.

A trsnaction is started upon creation of an OsidTransaction . Actions within a session are queued until the transaction is committed or aborted.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Cancels this transaction, rolling back the queue of operations since the start of this transaction.
    void
    Commits the transaction and makes the state change(s) visible.
    Gets the current state of this transaction.
    void
    Prepares for a commit .
  • Method Details

    • prepare

      Prepares for a commit . No further operations are permitted in the associated manager until this transaction is committed or aborted.
      Throws:
      IllegalStateException - this transaction has been committed or aborted
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      TransactionFailureException - this transaction cannot proceed due to a bad transaction element
      Compliance:
      mandatory - This method must be implemented.
      Notes:
      The - provider must verify this transaction such that a {@code commit} will succeed and reliably record the state changes resulting from this transaction before returning.
    • commit

      Commits the transaction and makes the state change(s) visible. This transaction is effectively closed and the only valid method that may be invoked is getState() .
      Throws:
      IllegalStateException - this transaction has been committed or aborted
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
      Notes:
      Any - resources allocated for this transaction can be released.
    • abort

      void abort()
      Cancels this transaction, rolling back the queue of operations since the start of this transaction. This transaction is effectively closed and the only valid method that may be invoked is getState() .
      Throws:
      IllegalStateException - this transaction has been committed or aborted
      Compliance:
      mandatory - This method must be implemented.
      Notes:
      Any - resources allocated for this transaction can be released.
    • getState

      TransactionState getState()
      Gets the current state of this transaction.
      Returns:
      the current state of this transaction
      Compliance:
      mandatory - This method must be implemented.