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

com.atomikos.icatch.jta

## Class RemoteClientUserTransaction

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

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

      public final class RemoteClientUserTransaction
      extends java.lang.Object
      implements javax.transaction.UserTransaction, java.io.Externalizable, javax.naming.Referenceable

  An implementation of a (remote) client's user transaction. Client applications can use the result to control transaction demarcation, and even pass their instance to other VMs so that those can share the same transaction context. The server-side applications can use the toString() method to obtain the transaction identifier of the transaction represented by an instance. This way, an incoming call from a client that demarcates its own transactions only has to ship the UserTransaction to the server (or to other clients) to identify what transaction it is in.
  NOTE: remote clients that use instances of this class can do transaction demarcation, but they can not do nested transactions!
  NOTE: instances that are meant to be bound in JNDI should be bound without any transaction context (i.e., without calling begin() first).
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RemoteClientUserTransaction()` No-argument constructor, as required by Externalizable interface.
    `RemoteClientUserTransaction(java.lang.String userTransactionServerLookupName, ConfigProperties configProperties)` Preferred constructor.
    `RemoteClientUserTransaction(java.lang.String name, java.lang.String initialContextFactory, java.lang.String providerUrl)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `begin()`
    `void` | `commit()`
    `javax.naming.Reference` | `getReference()`
    `int` | `getStatus()`
    `void` | `readExternal(java.io.ObjectInput in)`
    `void` | `rollback()`
    `void` | `setRollbackOnly()`
    `void` | `setTransactionTimeout(int seconds)`
    `java.lang.String` | `toString()` Overrides the default behaviour, to allow retrieving the corresponding transaction at the server side.
    `void` | `writeExternal(java.io.ObjectOutput out)` Needed to ship instances across the network among clients.

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

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

- - ### Constructor Detail

    - #### RemoteClientUserTransaction

          public RemoteClientUserTransaction()

      No-argument constructor, as required by Externalizable interface.

    - #### RemoteClientUserTransaction

          public RemoteClientUserTransaction(java.lang.String userTransactionServerLookupName,
                                     ConfigProperties configProperties)

      Preferred constructor.
      Parameters:
        `userTransactionServerLookupName` -
        `configProperties` -

    - #### RemoteClientUserTransaction

          public RemoteClientUserTransaction(java.lang.String name,
                                     java.lang.String initialContextFactory,
                                     java.lang.String providerUrl)

      Parameters:
        `name` - The unique name of the UserTransactionServer.
        `initialContextFactory` - The initial context factory of the server JNDI context.
        `providerUrl` - The provider URL of the server JNDI context.

  - ### Method Detail

    - #### begin

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

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

    - #### 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.UserTransaction`
      Throws:
        `javax.transaction.RollbackException`
        `javax.transaction.HeuristicMixedException`
        `javax.transaction.HeuristicRollbackException`
        `javax.transaction.SystemException`
        `java.lang.IllegalStateException`
        `java.lang.SecurityException`
      See Also:
        `UserTransaction`

    - #### rollback

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

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

    - #### setRollbackOnly

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

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

    - #### getStatus

          public int getStatus()
                        throws javax.transaction.SystemException

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

    - #### setTransactionTimeout

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

      Specified by:
        `setTransactionTimeout` in interface `javax.transaction.UserTransaction`
      Throws:
        `javax.transaction.SystemException`
      See Also:
        `UserTransaction`

    - #### toString

          public java.lang.String toString()

      Overrides the default behaviour, to allow retrieving the corresponding transaction at the server side.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        String The transaction ID (tid) of the transaction for which the thread is executing. Null if no transaction.

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

    - #### writeExternal

          public void writeExternal(java.io.ObjectOutput out)
                             throws java.io.IOException

      Needed to ship instances across the network among clients.
      Specified by:
        `writeExternal` in interface `java.io.Externalizable`
      Throws:
        `java.io.IOException`
      See Also:
        `Externalizable`

    - #### readExternal

          public void readExternal(java.io.ObjectInput in)
                            throws java.io.IOException,
                                   java.lang.ClassNotFoundException

      Specified by:
        `readExternal` in interface `java.io.Externalizable`
      Throws:
        `java.io.IOException`
        `java.lang.ClassNotFoundException`
      See Also:
        `Externalizable`

Copyright © 2018. All Rights Reserved.