com.holonplatform.datastore.jdbc.tx

## Interface JdbcTransaction

- All Superinterfaces:
    com.holonplatform.core.datastore.transaction.Transaction, com.holonplatform.core.datastore.transaction.TransactionStatus

      public interface JdbcTransaction
      extends com.holonplatform.core.datastore.transaction.Transaction

  JDBC `Transaction`.
  Since:
    5.1.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 JdbcTransaction` | `create(Connection connection, com.holonplatform.core.datastore.transaction.TransactionConfiguration configuration)` Create a new `JdbcTransaction`.
    `static JdbcTransaction` | `delegate(JdbcTransaction delegated)` Create a `JdbcTransaction` which delegates its operations and status to the given delegated transaction.
    `void` | `end()` Finalize the transaction.
    `com.holonplatform.core.datastore.transaction.TransactionConfiguration` | `getConfiguration()` Get the transaction configuration.
    `Connection` | `getConnection()` Get the JDBC connection bound to this transaction.
    `void` | `start()` Start the transaction.

    - ### 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. A `Connection` is obtained and configured according to the transaction configuration.
      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. The `Connection` bound to the transaction, if present, is released.
      Throws:
        `TransactionException` - If an error occurred
        `com.holonplatform.core.datastore.transaction.TransactionStatus.TransactionException`

    - #### getConnection

          Connection getConnection()

      Get the JDBC connection bound to this transaction.
      Returns:
        The JDBC connection bound to this transaction

    - #### getConfiguration

          com.holonplatform.core.datastore.transaction.TransactionConfiguration getConfiguration()

      Get the transaction configuration.
      Returns:
        the transaction configuration

    - #### create

          static JdbcTransaction create(Connection connection,
                                        com.holonplatform.core.datastore.transaction.TransactionConfiguration configuration)

      Create a new `JdbcTransaction`.
      Parameters:
        `connection` - Transaction `Connection` (not null)
        `configuration` - Transaction configuration (not null)
      Returns:
        A new `JdbcTransaction` implementation

    - #### delegate

          static JdbcTransaction delegate(JdbcTransaction delegated)

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

Copyright © 2019 The Holon Platform. All rights reserved.