com.holonplatform.core.datastore.transaction

## Interface TransactionStatus

- All Known Subinterfaces:
    AsyncTransaction, Transaction

      public interface TransactionStatus

  Represents the base API for a transaction, providing methods to inspect and manage the transaction status.
  Since:
    5.2.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `TransactionStatus.IllegalTransactionStatusException` Exception thrown when an operation is performed on a transaction but the transaction is in an illegal status according to the transaction semantics.
    `static class` | `TransactionStatus.TransactionException` Exception related to a transaction operation error.
    `static class` | `TransactionStatus.TransactionNotSupportedException` Exception throws when transaction are not actually supported by current implementation and/or driver.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isActive()` Get whether the transaction is active, that is, whether it is started and configured.
    `boolean` | `isCompleted()` Get whether this transaction is completed, that is, whether it has already been committed or rolled back.
    `boolean` | `isNew()` Return whether this transaction is new.
    `boolean` | `isRollbackOnly()` Return whether the transaction has been marked as rollback-only.
    `void` | `setRollbackOnly()` Mark this transaction so that the only possible outcome of the transaction is for the transaction to be rolled back.

- - ### Method Detail

    - #### setRollbackOnly

          void setRollbackOnly()

      Mark this transaction so that the only possible outcome of the transaction is for the transaction to be rolled back.
      Throws:
        `TransactionStatus.IllegalTransactionStatusException` - If the transaction is already completed (that is, committed or rolled back)

    - #### isRollbackOnly

          boolean isRollbackOnly()

      Return whether the transaction has been marked as rollback-only.
      Returns:
        `true` if the transaction has been marked as rollback-only, `false` otherwise

    - #### isActive

          boolean isActive()

      Get whether the transaction is active, that is, whether it is started and configured.
      Returns:
        Whether the transaction is active

    - #### isCompleted

          boolean isCompleted()

      Get whether this transaction is completed, that is, whether it has already been committed or rolled back.
      Returns:
        `true` if the transaction is completed, `false` otherwise

    - #### isNew

          boolean isNew()

      Return whether this transaction is new.
      Returns:
        `true` if this is a new transaction, `false` if participating in an existing transaction
      Since:
        5.2.0

Copyright © 2019 The Holon Platform. All rights reserved.