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
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(int time_out) Assume that a value of 0 at the client means the same at the server!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.createLocal
(int time_out) This creates a local instance of a transaction control, but does not register it with the ORB.static Control
static Control
createProxy
(Coordinator coordinator, Terminator terminator) static Control
createProxy
(Coordinator coordinator, Terminator terminator, Control parentControl) otid_t[]
getChildTransactions
(otid_t parent) getCurrentStatus
(otid_t txid) getOSStatus
(Uid u) final TransactionFactory
getTransaction
(otid_t txid) getTransactionInfo
(otid_t txid) otid_t[]
Now methods to return the identities of the currently running transactions, and those which have terminated but left entries in the object store.In Arjuna we can do low-cost nested aborts at clients which do not involve telling servers.Methods inherited from class com.arjuna.ArjunaOTS.ArjunaFactoryPOA
_all_interfaces, _invoke, _this, _this
Methods inherited from class org.omg.PortableServer.Servant
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
-
Constructor Details
-
TransactionFactoryImple
public TransactionFactoryImple() -
TransactionFactoryImple
-
-
Method Details
-
getReference
-
create
Assume that a value of 0 at the client means the same at the server!- Throws:
org.omg.CORBA.SystemException
-
createLocal
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
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
- Throws:
org.omg.CORBA.SystemException
-
create_subtransaction
Non-idl methods, but we put them here because they are related to the work the factory does. -
createProxy
-
createProxy
public static Control createProxy(Coordinator coordinator, Terminator terminator, Control parentControl) -
createPropagatedControl
-
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
- 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
- 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
- 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
- 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
- Returns:
- the status of the transaction as recorded in the object store.
- Throws:
NoTransaction
org.omg.CORBA.SystemException
- Since:
- JTS 2.1.1.
-
getGlobalInfo
- 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
- Returns:
- the transaction Control.
- Throws:
NoTransaction
org.omg.CORBA.SystemException
- Since:
- JTS 2.1.2.
-
getTransaction
- Returns:
- the transaction Control.
- Throws:
NoTransaction
org.omg.CORBA.SystemException
- Since:
- JTS 2.1.2.
-