com.holonplatform.jdbc.spring.internal

## Class SpringManagedTransaction

- java.lang.Object
- - com.holonplatform.jdbc.spring.internal.SpringManagedTransaction

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

      public abstract class SpringManagedTransaction
      extends Object
      implements com.holonplatform.core.datastore.transaction.Transaction

  Base `Transaction` implementation which uses a Spring `PlatformTransactionManager` to manage the actual transaction. `startTransaction()` and `endTransaction()` methods should be used to handle transaction lifecycle.
  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`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SpringManagedTransaction(org.springframework.transaction.PlatformTransactionManager transactionManager, com.holonplatform.core.datastore.transaction.TransactionConfiguration configuration)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `commit()`
    `com.holonplatform.core.datastore.transaction.TransactionConfiguration` | `getConfiguration()` Get the transaction configuration.
    `boolean` | `isCompleted()`
    `boolean` | `isRollbackOnly()`
    `void` | `rollback()`
    `void` | `setRollbackOnly()`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

      `isActive, isNew`

- - ### Constructor Detail

    - #### SpringManagedTransaction

          public SpringManagedTransaction(org.springframework.transaction.PlatformTransactionManager transactionManager,
                                          com.holonplatform.core.datastore.transaction.TransactionConfiguration configuration)

      Constructor.
      Parameters:
        `transactionManager` - The `PlatformTransactionManager` to use (not null)
        `configuration` - The transaction configuration (not null)

  - ### Method Detail

    - #### getConfiguration

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

      Get the transaction configuration.
      Returns:
        the transaction configuration

    - #### commit

          public boolean commit()
                         throws com.holonplatform.core.datastore.transaction.TransactionStatus.TransactionException

      Specified by:
        `commit` in interface `com.holonplatform.core.datastore.transaction.Transaction`
      Throws:
        `com.holonplatform.core.datastore.transaction.TransactionStatus.TransactionException`

    - #### rollback

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

      Specified by:
        `rollback` in interface `com.holonplatform.core.datastore.transaction.Transaction`
      Throws:
        `com.holonplatform.core.datastore.transaction.TransactionStatus.TransactionException`

    - #### isCompleted

          public boolean isCompleted()

      Specified by:
        `isCompleted` in interface `com.holonplatform.core.datastore.transaction.TransactionStatus`

    - #### setRollbackOnly

          public void setRollbackOnly()

      Specified by:
        `setRollbackOnly` in interface `com.holonplatform.core.datastore.transaction.TransactionStatus`

    - #### isRollbackOnly

          public boolean isRollbackOnly()

      Specified by:
        `isRollbackOnly` in interface `com.holonplatform.core.datastore.transaction.TransactionStatus`

Copyright © 2019 The Holon Platform. All rights reserved.