com.holonplatform.datastore.mongo.sync.tx

## Interface SyncMongoTransaction

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

      public interface SyncMongoTransaction
      extends MongoTransaction<com.mongodb.client.ClientSession>, com.holonplatform.core.datastore.transaction.Transaction

  Synchronous 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 SyncMongoTransaction` | `create(com.mongodb.client.ClientSession session, com.holonplatform.core.datastore.transaction.TransactionConfiguration configuration)` Create a new `SyncMongoTransaction`.
    `static SyncMongoTransaction` | `delegate(SyncMongoTransaction delegated)` Create a `SyncMongoTransaction` which delegates its operations and status to the given delegated transaction.
    `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.core.datastore.transaction.Transaction

      `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

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

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

    - #### create

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

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

    - #### delegate

          static SyncMongoTransaction delegate(SyncMongoTransaction delegated)

      Create a `SyncMongoTransaction` 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 `SyncMongoTransaction` implementation

Copyright © 2019 The Holon Platform. All rights reserved.