com.holonplatform.datastore.mongo.async.tx

## Interface AsyncMongoTransaction

- All Superinterfaces:
    com.holonplatform.async.datastore.transaction.AsyncTransaction, MongoTransaction<com.mongodb.reactivestreams.client.ClientSession>, com.holonplatform.core.datastore.transaction.TransactionStatus

      public interface AsyncMongoTransaction
      extends MongoTransaction<com.mongodb.reactivestreams.client.ClientSession>, com.holonplatform.async.datastore.transaction.AsyncTransaction

  Asynchronous MongoDB `Transaction`.
  Since:
    5.2.0

- - ### Nested Class Summary

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

      `com.holonplatform.core.datastore.transaction.TransactionStatus.IllegalTransactionStatusException, com.holonplatform.core.datastore.transaction.TransactionStatus.TransactionException, com.holonplatform.core.datastore.transaction.TransactionStatus.TransactionNotSupportedException`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static AsyncMongoTransaction` | `create(com.mongodb.reactivestreams.client.ClientSession session, com.holonplatform.core.datastore.transaction.TransactionConfiguration configuration)` Create a new `AsyncMongoTransaction`.
    `static AsyncMongoTransaction` | `delegate(AsyncMongoTransaction delegated)` Create a `AsyncMongoTransaction` which delegates its operations and status to the given delegated transaction.
    `CompletionStage<Void>` | `end()` Finalize the transaction.
    `void` | `start()` Start the transaction.

    - ### Methods inherited from interface com.holonplatform.datastore.mongo.core.tx.MongoTransaction

      `getConfiguration, getSession`

    - ### Methods inherited from interface com.holonplatform.async.datastore.transaction.AsyncTransaction

      `commit, rollback`

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

      `isActive, isCompleted, isNew, isRollbackOnly, setRollbackOnly`

- - ### Method Detail

    - #### start

          void start()
              throws com.holonplatform.core.datastore.transaction.TransactionStatus.TransactionException

      Start the transaction.
      Throws:
        `TransactionException` - If an error occurred
        `com.holonplatform.core.datastore.transaction.TransactionStatus.TransactionException`

    - #### end

          CompletionStage<Void> end()
                             throws com.holonplatform.core.datastore.transaction.TransactionStatus.TransactionException

      Finalize the transaction.
      Returns:
        A `CompletionStage` to handle the transaction end asynchronously
      Throws:
        `TransactionException` - If an error occurred
        `com.holonplatform.core.datastore.transaction.TransactionStatus.TransactionException`

    - #### create

          static AsyncMongoTransaction create(com.mongodb.reactivestreams.client.ClientSession session,
                                              com.holonplatform.core.datastore.transaction.TransactionConfiguration configuration)

      Create a new `AsyncMongoTransaction`.
      Parameters:
        `session` - Client session (not null)
        `configuration` - Transaction configuration (not null)
      Returns:
        A new `AsyncMongoTransaction` implementation

    - #### delegate

          static AsyncMongoTransaction delegate(AsyncMongoTransaction delegated)

      Create a `AsyncMongoTransaction` which delegates its operations and status to the given delegated transaction.

      The delegated transaction returns `false` from the `TransactionStatus.isNew()` method.

      Parameters:
        `delegated` - Delegated transaction (not null)
      Returns:
        A delegated `AsyncMongoTransaction` implementation

Copyright © 2019 The Holon Platform. All rights reserved.