JBoss.orgCommunity Documentation
The JBossTS run-time support consists of run-time packages and the OTS transaction manager server. By default, JBossTS does not use a separate transaction manager server. Instead, transaction managers are co-located with each application process to improve performance and improve application fault-tolerance by reducing application dependency on other services.
When running applications which require a separate transaction manager, set the
JTSEnvironmentBean.transactionManager
environment variable to value YES
. The system locates the
transaction manager server in a manner specific to the ORB being used. This method may be any of:
Being registered with a name server.
Being added to the ORB’s initial references.
Via a JBossTS specific references file.
By the ORB’s specific location mechanism (if applicable).
You override the default registration mechanism by using the
OrbPortabilityEnvironmentBean.resolveService
environment variable, which takes the following
values:
Table 3.1. Possible values of OrbPortabilityEnvironmentBean.resolveService
CONFIGURATION_FILE |
This is the default, and causes the system to use the |
NAME_SERVICE |
JBossTS attempts to use a name service to register the transaction factory. If this is not supported, an exception is thrown. |
BIND_CONNECT |
JBossTS uses the ORB-specific bind mechanism. If this is not supported, an exception is thrown. |
RESOLVE_INITIAL_REFERENCES |
JBossTS attempts to register the transaction service with the ORB's initial service references. If the ORB does not support this, an exception is thrown, and another option must be used. |
Similar to the resolve_initial_references
, JBossTS supports an initial reference file
where references for specific services can be stored and used at runtime. The file,
CosServices.cfg
, consists of two columns: the service name (in the case of the OTS server
TransactionService), and the IOR, separated by a single space. CosServices.cfg
is located
at runtime by the following OrbPortabilityEnvironmentBean
properties:
initialReferencesRoot |
The directory where the file is located, defaulting to the current working directory. |
initialReferencesFile |
The name of the configuration file itself, |
The OTS server automatically registers itself in the CosServices.cfg
file if the
OrbPortabilityEnvironmentBean
option is used, creating the file if necessary. Stale
information is also automatically removed. Machines sharing the same transaction server should have access to
this file, or a copy of it locally.
Example 3.1. Example ORB reference file settings
OrbPortabilityEnvironmentBean.initialReferencesFile
=myFile
OrbPortabilityEnvironmentBean.initialReferencesRoot
=/tmp
If your ORB supports a name service, and JBossTS is configured to use it, the transaction manager is registered with it automatically. There is no further work required.
This option is not used for JacORB
Each XA Xid that JBossTS creates must have a unique node identifier encoded within it. JBossTS only recovers
transactions and states that match a specified node identifier. Provide the node identifier with the
CoreEnvironmentBean.nodeIdentifier
property. This value must be unique across your JBossTS
instances. If you do not provide a value, JBossTS generates one and reports the value via the logging
infrastructure.
When running XA recovery, you need to specify which types of Xid JBossTS can recover. Use the
JTAEnvironmentBean.xaRecoveryNodes
property to provide one or more values, in a space-separated
list.
A value of ‘*’ forces JBossTS to recover, and possibly rollback, all transactions, regardless of their node identifier. Use this value with extreme caution.
Two variants of the JTA implementation are now provided and accessible through the same interface. These are:
Only non-distributed JTA transactions can be executed. This is the only version available with the JBossJTA product.
Distributed JTA transactions can be executed. This version is only available with the JBossTS product and requires a supported CORBA ORB.
Both of these implementations are fully compatible with the transactional JDBC driver provided with JBossTS.
Procedure 3.1. Selecting the local JTA implementation
Set the property JTAEnvironmentBean.jtaTMImplementation
to value
com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple
.
Set the property JTAEnvironmentBean.jtaUTImplementation
to value
com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple
.
These settings are the default values for the properties and do not need to be specified if the local implementation is required.
Procedure 3.2. Selecting the remote JTA implementation
Set the property JTAEnvironmentBean.jtaTMImplementation
to value
com.arjuna.ats.internal.jta.transaction.jts..TransactionManagerImple
.
Set the property JTAEnvironmentBean.jtaUTImplementation
to value
com.arjuna.ats.internal.jta.transaction.jts.UserTransactionImple
.