Class TransactionFactoryImple

java.lang.Object
org.omg.PortableServer.Servant
com.arjuna.ArjunaOTS.ArjunaFactoryPOA
com.arjuna.ats.internal.jts.orbspecific.TransactionFactoryImple
All Implemented Interfaces:
ArjunaFactoryOperations, org.omg.CORBA.portable.InvokeHandler, TransactionFactoryOperations

public class TransactionFactoryImple extends ArjunaFactoryPOA
An implementation of ArjunaOTS::ArjunaFactory. Problem: garbage collection! If a user keeps a reference to a Control, say, then we will delete the implementation object when the action terminates. However, the user's reference is still valid, only the thing it points to is no longer there. In the remote case this is ok as the Orb will raise an exception. In the local case, however, the program is likely to crash when it tries to dereference freed memory! There's nothing we can do about this (unless we decide never to garbage collect!) apart from warn against using Control, Coordinator, and Terminator explicitly - if you go via Current then everything's ok.
Since:
JTS 1.0.
Version:
$Id: TransactionFactoryImple.java 2342 2006-03-30 13:06:17Z $
Author:
Mark Little (mark@arjuna.com)
  • Constructor Details

    • TransactionFactoryImple

      public TransactionFactoryImple()
    • TransactionFactoryImple

      public TransactionFactoryImple(String name)
  • Method Details

    • getReference

      public final TransactionFactory getReference()
    • create

      public Control create(int time_out) throws org.omg.CORBA.SystemException
      Assume that a value of 0 at the client means the same at the server!
      Throws:
      org.omg.CORBA.SystemException
    • createLocal

      public ControlImple createLocal(int time_out) throws org.omg.CORBA.SystemException
      This creates a local instance of a transaction control, but does not register it with the ORB. Either call its getControl method directly, or use the create method of the factory.
      Throws:
      org.omg.CORBA.SystemException
    • recreateLocal

      public ControlImple recreateLocal(PropagationContext ctx) throws org.omg.CORBA.SystemException
      In Arjuna we can do low-cost nested aborts at clients which do not involve telling servers. The server finds out the next time a call is made when it checks the hierarchy.
      Throws:
      org.omg.CORBA.SystemException
    • recreate

      public Control recreate(PropagationContext ctx) throws org.omg.CORBA.SystemException
      Throws:
      org.omg.CORBA.SystemException
    • create_subtransaction

      public static Control create_subtransaction(Control control, ArjunaTransactionImple parent)
      Non-idl methods, but we put them here because they are related to the work the factory does.
    • createProxy

      public static Control createProxy(Coordinator coordinator, Terminator terminator)
    • createProxy

      public static Control createProxy(Coordinator coordinator, Terminator terminator, Control parentControl)
    • createPropagatedControl

      public static Control createPropagatedControl(Coordinator coord)
    • numberOfTransactions

      public otid_t[] numberOfTransactions(TransactionType t) throws Inactive, NoTransaction, org.omg.CORBA.SystemException
      Now methods to return the identities of the currently running transactions, and those which have terminated but left entries in the object store. WARNING: these methods should be used sparingly since they *must* lock the transaction database while examining it, and this will prevent any new transactions from being created/started.
      Parameters:
      the - type of transaction (active, unresolved) to get data on.
      Throws:
      Inactive
      NoTransaction
      org.omg.CORBA.SystemException
      Since:
      JTS 2.1.
    • getChildTransactions

      public otid_t[] getChildTransactions(otid_t parent) throws Inactive, NoTransaction, org.omg.CORBA.SystemException
      Returns:
      the list of child transactions.
      Throws:
      Inactive
      NoTransaction
      org.omg.CORBA.SystemException
    • getCurrentStatus

      public Status getCurrentStatus(otid_t txid) throws org.omg.CORBA.SystemException
      Returns:
      the status of a transaction when all we have is its unique name. The transaction must be in the local list.
      Throws:
      org.omg.CORBA.SystemException
      Since:
      JTS 2.1.2.
    • getCurrentStatus

      public Status getCurrentStatus(Uid u) throws org.omg.CORBA.SystemException
      Returns:
      the status of a transaction when all we have is its unique name. The transaction must be in the local list.
      Throws:
      org.omg.CORBA.SystemException
      Since:
      JTS 2.1.
    • getStatus

      public Status getStatus(otid_t txid) throws NoTransaction, org.omg.CORBA.SystemException
      Returns:
      the status of a transaction when all we have is its unique name. If the transaction is not in the local list then we look in the ObjectStore.
      Throws:
      NoTransaction
      org.omg.CORBA.SystemException
      Since:
      JTS 2.1.2.
    • getStatus

      public Status getStatus(Uid u) throws NoTransaction, org.omg.CORBA.SystemException
      Returns:
      the status of a transaction when all we have is its unique name. If the transaction is not in the local list then we look in the ObjectStore.
      Throws:
      NoTransaction
      org.omg.CORBA.SystemException
      Since:
      JTS 2.1.
    • getOSStatus

      public Status getOSStatus(Uid u) throws NoTransaction, org.omg.CORBA.SystemException
      Returns:
      the status of the transaction as recorded in the object store.
      Throws:
      NoTransaction
      org.omg.CORBA.SystemException
      Since:
      JTS 2.1.1.
    • getGlobalInfo

      public GlobalTransactionInfo getGlobalInfo() throws org.omg.CORBA.SystemException
      Throws:
      org.omg.CORBA.SystemException
    • getTransactionInfo

      public TransactionInfo getTransactionInfo(otid_t txid) throws NoTransaction, org.omg.CORBA.SystemException
      Returns:
      information on a specific transaction.
      Throws:
      NoTransaction
      org.omg.CORBA.SystemException
      Since:
      JTS 2.1.2.
    • getTransactionInfo

      public TransactionInfo getTransactionInfo(Uid u) throws NoTransaction, org.omg.CORBA.SystemException
      Returns:
      information on a specific transaction.
      Throws:
      NoTransaction
      org.omg.CORBA.SystemException
      Since:
      JTS 2.1.2.
    • getTransaction

      public Control getTransaction(otid_t txid) throws NoTransaction, org.omg.CORBA.SystemException
      Returns:
      the transaction Control.
      Throws:
      NoTransaction
      org.omg.CORBA.SystemException
      Since:
      JTS 2.1.2.
    • getTransaction

      public Control getTransaction(Uid u) throws NoTransaction, org.omg.CORBA.SystemException
      Returns:
      the transaction Control.
      Throws:
      NoTransaction
      org.omg.CORBA.SystemException
      Since:
      JTS 2.1.2.