UserTransactionManager (Transactions JTA 4.0.6 API)
Date: 2018-01-11

com.atomikos.icatch.jta

## Class UserTransactionManager

- java.lang.Object
- - com.atomikos.icatch.jta.UserTransactionManager

- All Implemented Interfaces:
    java.io.Serializable, javax.naming.Referenceable, javax.transaction.TransactionManager, javax.transaction.UserTransaction

      public class UserTransactionManager
      extends java.lang.Object
      implements javax.transaction.TransactionManager, java.io.Serializable, javax.naming.Referenceable, javax.transaction.UserTransaction

  A straightforward, zero-setup implementation of a transaction manager. Applications can use an instance of this class to get a handle to the transaction manager, and automatically startup or recover the transaction service on first use.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserTransactionManager()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `begin()`
    `void` | `close()` Closes the transaction service, but only if it was implicitly started via this instance.
    `void` | `commit()`
    `boolean` | `getForceShutdown()`
    `javax.naming.Reference` | `getReference()`
    `boolean` | `getStartupTransactionService()` Returns true if the transaction service will be started if not already running.
    `int` | `getStatus()`
    `javax.transaction.Transaction` | `getTransaction()`
    `void` | `init()` Performs initialization if necessary.
    `void` | `resume(javax.transaction.Transaction tx)`
    `void` | `rollback()`
    `void` | `setForceShutdown(boolean value)` Sets the force shutdown mode to use during close.
    `void` | `setRollbackOnly()`
    `void` | `setStartupTransactionService(boolean startup)` Sets whether the transaction service should be started if not already running.
    `void` | `setTransactionTimeout(int secs)`
    `javax.transaction.Transaction` | `suspend()`

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

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

- - ### Constructor Detail

    - #### UserTransactionManager

          public UserTransactionManager()

  - ### Method Detail

    - #### setStartupTransactionService

          public void setStartupTransactionService(boolean startup)

      Sets whether the transaction service should be started if not already running. Optional, defaults to true.
      Parameters:
        `startup` -

    - #### getStartupTransactionService

          public boolean getStartupTransactionService()

      Returns true if the transaction service will be started if not already running.
      Returns:

    - #### init

          public void init()
                    throws javax.transaction.SystemException

      Performs initialization if necessary. This will startup the TM (if not running) and perform recovery, unless getStartupTransactionService returns false.
      Throws:
        `javax.transaction.SystemException`

    - #### begin

          public void begin()
                     throws javax.transaction.NotSupportedException,
                            javax.transaction.SystemException

      Specified by:
        `begin` in interface `javax.transaction.TransactionManager`
      Specified by:
        `begin` in interface `javax.transaction.UserTransaction`
      Throws:
        `javax.transaction.NotSupportedException`
        `javax.transaction.SystemException`
      See Also:
        `TransactionManager.begin()`

    - #### getForceShutdown

          public boolean getForceShutdown()

    - #### setForceShutdown

          public void setForceShutdown(boolean value)

      Sets the force shutdown mode to use during close.
      Parameters:
        `value` -

    - #### commit

          public void commit()
                      throws javax.transaction.RollbackException,
                             javax.transaction.HeuristicMixedException,
                             javax.transaction.HeuristicRollbackException,
                             java.lang.SecurityException,
                             java.lang.IllegalStateException,
                             javax.transaction.SystemException

      Specified by:
        `commit` in interface `javax.transaction.TransactionManager`
      Specified by:
        `commit` in interface `javax.transaction.UserTransaction`
      Throws:
        `javax.transaction.RollbackException`
        `javax.transaction.HeuristicMixedException`
        `javax.transaction.HeuristicRollbackException`
        `java.lang.SecurityException`
        `java.lang.IllegalStateException`
        `javax.transaction.SystemException`
      See Also:
        `TransactionManager.commit()`

    - #### getStatus

          public int getStatus()
                        throws javax.transaction.SystemException

      Specified by:
        `getStatus` in interface `javax.transaction.TransactionManager`
      Specified by:
        `getStatus` in interface `javax.transaction.UserTransaction`
      Throws:
        `javax.transaction.SystemException`
      See Also:
        `TransactionManager.getStatus()`

    - #### getTransaction

          public javax.transaction.Transaction getTransaction()
                                                       throws javax.transaction.SystemException

      Specified by:
        `getTransaction` in interface `javax.transaction.TransactionManager`
      Throws:
        `javax.transaction.SystemException`
      See Also:
        `TransactionManager.getTransaction()`

    - #### resume

          public void resume(javax.transaction.Transaction tx)
                      throws javax.transaction.InvalidTransactionException,
                             java.lang.IllegalStateException,
                             javax.transaction.SystemException

      Specified by:
        `resume` in interface `javax.transaction.TransactionManager`
      Throws:
        `javax.transaction.InvalidTransactionException`
        `java.lang.IllegalStateException`
        `javax.transaction.SystemException`
      See Also:
        `TransactionManager.resume(javax.transaction.Transaction)`

    - #### rollback

          public void rollback()
                        throws java.lang.IllegalStateException,
                               java.lang.SecurityException,
                               javax.transaction.SystemException

      Specified by:
        `rollback` in interface `javax.transaction.TransactionManager`
      Specified by:
        `rollback` in interface `javax.transaction.UserTransaction`
      Throws:
        `java.lang.IllegalStateException`
        `java.lang.SecurityException`
        `javax.transaction.SystemException`
      See Also:
        `TransactionManager.rollback()`

    - #### setRollbackOnly

          public void setRollbackOnly()
                               throws java.lang.IllegalStateException,
                                      javax.transaction.SystemException

      Specified by:
        `setRollbackOnly` in interface `javax.transaction.TransactionManager`
      Specified by:
        `setRollbackOnly` in interface `javax.transaction.UserTransaction`
      Throws:
        `java.lang.IllegalStateException`
        `javax.transaction.SystemException`
      See Also:
        `TransactionManager.setRollbackOnly()`

    - #### setTransactionTimeout

          public void setTransactionTimeout(int secs)
                                     throws javax.transaction.SystemException

      Specified by:
        `setTransactionTimeout` in interface `javax.transaction.TransactionManager`
      Specified by:
        `setTransactionTimeout` in interface `javax.transaction.UserTransaction`
      Throws:
        `javax.transaction.SystemException`
      See Also:
        `TransactionManager.setTransactionTimeout(int)`

    - #### suspend

          public javax.transaction.Transaction suspend()
                                                throws javax.transaction.SystemException

      Specified by:
        `suspend` in interface `javax.transaction.TransactionManager`
      Throws:
        `javax.transaction.SystemException`
      See Also:
        `TransactionManager.suspend()`

    - #### getReference

          public javax.naming.Reference getReference()
                                              throws javax.naming.NamingException

      Specified by:
        `getReference` in interface `javax.naming.Referenceable`
      Throws:
        `javax.naming.NamingException`
      See Also:
        `Referenceable.getReference()`

    - #### close

          public void close()

      Closes the transaction service, but only if it was implicitly started via this instance. In other words, if the transaction service was started in another way then this method will not do anything.

Copyright © 2018. All Rights Reserved.