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

com.atomikos.icatch.jta

## Class TransactionManagerImp

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

- All Implemented Interfaces:
    SubTxAwareParticipant, javax.naming.Referenceable, javax.transaction.TransactionManager, javax.transaction.UserTransaction

      public class TransactionManagerImp
      extends java.lang.Object
      implements javax.transaction.TransactionManager, SubTxAwareParticipant, javax.naming.Referenceable, javax.transaction.UserTransaction

  The main JTA transaction manager singleton.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `JTA_PROPERTY_NAME` Transaction property name to indicate that the transaction is a JTA transaction.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `begin()` Creates a new transaction and associate it with the current thread.
    `void` | `begin(int timeout)` Custom begin to guarantee a timeout value through an argument.
    `void` | `commit()`
    `void` | `committed(CompositeTransaction tx)`
    `static boolean` | `getDefaultSerial()` Gets the default mode for new txs.
    `static int` | `getDefaultTimeout()` Get the default timeout value.
    `javax.naming.Reference` | `getReference()`
    `int` | `getStatus()`
    `javax.transaction.Transaction` | `getTransaction()`
    `javax.transaction.Transaction` | `getTransaction(java.lang.String tid)` Gets any previous transaction with the given identifier.
    `static javax.transaction.TransactionManager` | `getTransactionManager()` Gets the installed transaction manager, if any.
    `int` | `getTransactionTimeout()`
    `static void` | `installTransactionManager(CompositeTransactionManager ctm, boolean automaticResourceRegistration)` Install a transaction manager.
    `void` | `resume(javax.transaction.Transaction tobj)`
    `void` | `rollback()`
    `void` | `rolledback(CompositeTransaction tx)`
    `static void` | `setDefaultSerial(boolean value)` Sets the default serial mode for new txs.
    `static void` | `setDefaultTimeout(int defaultTimeoutValueInSeconds)` Set the default transaction timeout value.
    `void` | `setRollbackOnly()`
    `void` | `setTransactionTimeout(int seconds)`
    `javax.transaction.Transaction` | `suspend()`

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

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

- - ### Field Detail

    - #### JTA_PROPERTY_NAME

          public static final java.lang.String JTA_PROPERTY_NAME

      Transaction property name to indicate that the transaction is a JTA transaction. If this property is set to an arbitrary non-null value then a JTA transaction is assumed by this class. This property is used for detecting incompatible existing transactions: if a transaction exists without this property then the begin method will suspend it (and resume afterwards).
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### setDefaultSerial

          public static void setDefaultSerial(boolean value)

      Sets the default serial mode for new txs.
      Parameters:
        `value` - If true, then new txs will be set to serial mode.

    - #### getDefaultSerial

          public static boolean getDefaultSerial()

      Gets the default mode for new txs.
      Returns:
        boolean If true, then new txs started through here will be in serial mode.

    - #### setDefaultTimeout

          public static void setDefaultTimeout(int defaultTimeoutValueInSeconds)

      Set the default transaction timeout value.
      Parameters:
        `defaultTimeoutValueInSeconds` - the default transaction timeout value in seconds.

    - #### getDefaultTimeout

          public static int getDefaultTimeout()

      Get the default timeout value.
      Returns:
        the default transaction timeout value in seconds.

    - #### installTransactionManager

          public static void installTransactionManager(CompositeTransactionManager ctm,
                                       boolean automaticResourceRegistration)

      Install a transaction manager.
      Parameters:
        `ctm` - The composite transaction manager to use.
        `automaticResourceRegistration` - If true, then unknown XAResource instances should lead to the addition of a new temporary resource. If false, then unknown resources will lead to an exception.

    - #### getTransactionManager

          public static javax.transaction.TransactionManager getTransactionManager()

      Gets the installed transaction manager, if any.
      Returns:
        TransactionManager The installed instance, null if none.

    - #### getTransaction

          public javax.transaction.Transaction getTransaction(java.lang.String tid)

      Gets any previous transaction with the given identifier.
      Returns:
        Transaction The instance, or null if not found.

    - #### begin

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

      Creates a new transaction and associate it with the current thread. If the current thread already has a transaction, then a local subtransaction will be created.
      Specified by:
        `begin` in interface `javax.transaction.TransactionManager`
      Specified by:
        `begin` in interface `javax.transaction.UserTransaction`
      Throws:
        `javax.transaction.NotSupportedException`
        `javax.transaction.SystemException`

    - #### begin

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

      Custom begin to guarantee a timeout value through an argument.
      Throws:
        `javax.transaction.NotSupportedException`
        `javax.transaction.SystemException`

    - #### 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`

    - #### setTransactionTimeout

          public void setTransactionTimeout(int seconds)
                                     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`

    - #### getTransactionTimeout

          public int getTransactionTimeout()

    - #### 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`

    - #### resume

          public void resume(javax.transaction.Transaction tobj)
                      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`

    - #### 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`

    - #### commit

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

      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`
        `javax.transaction.SystemException`
        `java.lang.IllegalStateException`
        `java.lang.SecurityException`
      See Also:
        `TransactionManager`

    - #### rollback

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

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

    - #### 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`

    - #### committed

          public void committed(CompositeTransaction tx)

      Specified by:
        `committed` in interface `SubTxAwareParticipant`
      See Also:
        `SubTxAwareParticipant`

    - #### rolledback

          public void rolledback(CompositeTransaction tx)

      Specified by:
        `rolledback` in interface `SubTxAwareParticipant`
      See Also:
        `SubTxAwareParticipant`

    - #### 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()`

Copyright © 2018. All Rights Reserved.