com.holonplatform.core.datastore.transaction

## Interface Transaction

- All Superinterfaces:
    TransactionStatus

      public interface Transaction
      extends TransactionStatus

  Represents a Datastore transaction, providing methods to commit and rollback the transaction.
  Since:
    5.1.0

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.datastore.transaction.TransactionStatus

      `TransactionStatus.IllegalTransactionStatusException, TransactionStatus.TransactionException, TransactionStatus.TransactionNotSupportedException`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `commit()` Commit the transaction.
    `void` | `rollback()` Rollback the transaction.

    - ### Methods inherited from interface com.holonplatform.core.datastore.transaction.TransactionStatus

      `isActive, isCompleted, isNew, isRollbackOnly, setRollbackOnly`

- - ### Method Detail

    - #### commit

          boolean commit()
                  throws TransactionStatus.TransactionException

      Commit the transaction.

      If the transaction has been marked as rollback-only, a rollback action is performed.

      Returns:
        `true` if the transaction was actually committed, or `false` if it was rolled back because the the transaction has been marked as rollback-only
      Throws:
        `IllegalTransactionStatusException` - If the transaction is already completed (that is, committed or rolled back)
        `TransactionException` - If an error occurred during transaction commit
        `TransactionStatus.TransactionException`

    - #### rollback

          void rollback()
                 throws TransactionStatus.TransactionException

      Rollback the transaction.
      Throws:
        `IllegalTransactionStatusException` - If the transaction is already completed (that is, committed or rolled back)
        `TransactionException` - If an error occurred during transaction rollback
        `TransactionStatus.TransactionException`

Copyright © 2019 The Holon Platform. All rights reserved.