Package org.apache.batchee.container.services.transaction

## Class JTAUserTransactionAdapter

- java.lang.Object
- - org.apache.batchee.container.services.transaction.JTAUserTransactionAdapter

- All Implemented Interfaces:
    `TransactionManagerAdapter`

      public class JTAUserTransactionAdapter
      extends Object
      implements TransactionManagerAdapter

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected TransactionManager` | `mgr` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `JTAUserTransactionAdapter()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `begin()` | Create a new transaction and associate it with the current thread.
    `Transaction` | `beginSuspending()` |
    `void` | `commit()` | Complete the transaction associated with the current thread.
    `int` | `getStatus()` | Obtain the status of the transaction associated with the current thread.
    `void` | `resume​(Transaction transaction)` |
    `void` | `rollback()` | Roll back the transaction associated with the current thread.
    `void` | `setRollbackOnly()` | Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
    `void` | `setTransactionTimeout​(int seconds)` | Modify the value of the timeout value that is associated with the transactions started by the current thread with the begin method.

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

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

- - ### Field Detail

    - #### mgr

          protected TransactionManager mgr

  - ### Constructor Detail

    - #### JTAUserTransactionAdapter

          public JTAUserTransactionAdapter()

  - ### Method Detail

    - #### begin

          public void begin()
                     throws TransactionManagementException

      Description copied from interface: `TransactionManagerAdapter`
      Create a new transaction and associate it with the current thread.
      Specified by:
        `begin` in interface `TransactionManagerAdapter`
      Throws:
        `TransactionManagementException`

    - #### beginSuspending

          public Transaction beginSuspending()
                                      throws TransactionManagementException

      Throws:
        `TransactionManagementException`

    - #### resume

          public void resume​(Transaction transaction)

    - #### commit

          public void commit()
                      throws TransactionManagementException

      Description copied from interface: `TransactionManagerAdapter`
      Complete the transaction associated with the current thread.
      Specified by:
        `commit` in interface `TransactionManagerAdapter`
      Throws:
        `TransactionManagementException`

    - #### rollback

          public void rollback()
                        throws TransactionManagementException

      Description copied from interface: `TransactionManagerAdapter`
      Roll back the transaction associated with the current thread. When this method completes, the thread becomes associated with no transaction. Attention: this must not throw an Exception until there is a setup problem! So if the tx is not active anymore and we get an Exception while trying to rollback then it MUST get catched away. Otoh if there is a setup or system issue the Exception from the rollback needs to get thrown.
      Specified by:
        `rollback` in interface `TransactionManagerAdapter`
      Throws:
        `TransactionManagementException`

    - #### getStatus

          public int getStatus()
                        throws TransactionManagementException

      Description copied from interface: `TransactionManagerAdapter`
      Obtain the status of the transaction associated with the current thread.
      Specified by:
        `getStatus` in interface `TransactionManagerAdapter`
      Returns:
        The transaction status.
      Throws:
        `TransactionManagementException`

    - #### setRollbackOnly

          public void setRollbackOnly()
                               throws TransactionManagementException

      Description copied from interface: `TransactionManagerAdapter`
      Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
      Specified by:
        `setRollbackOnly` in interface `TransactionManagerAdapter`
      Throws:
        `TransactionManagementException`

    - #### setTransactionTimeout

          public void setTransactionTimeout​(int seconds)
                                     throws TransactionManagementException

      Description copied from interface: `TransactionManagerAdapter`
      Modify the value of the timeout value that is associated with the transactions started by the current thread with the begin method.
      Specified by:
        `setTransactionTimeout` in interface `TransactionManagerAdapter`
      Parameters:
        `seconds` - seconds - The value of the timeout in seconds. If the value is zero, the transaction service restores the default value.
      Throws:
        `TransactionManagementException`