[Top] [Previous Page] [Next Page] [Bottom]



Chapter 7. Configuring Transactions

This chapter discusses the following topics:

Understanding Transactions

Transactions greatly simplify the writing of distributed applications. They allow your application to cope more easily with a large set of problems that occur in a distributed environment, such as machine, program, or network failures. One of the greatest strengths of the BEA TUXEDO system is that the transaction semantic was built into the software and into the TUXEDO ATMI. Global transactions were woven into the fabric of the system and into its communication APIs and protocols.

The ability to define a global transaction around communication calls makes it an indispensable tool for writing distributed applications. A global transaction allows not only the effects of your communications to be committed as a single unit, but it also gives you a simple, programmatic way to undo work if errors occur.

To illustrate the power of global transactions, consider the following example. A Place Order service performs two operations: it updates the Order database and enqueues the order to the shipping department. The business intends that both these actions occur together as a unit or that neither action should occur if one action fails.

To accomplish this, the client application invoking the Place Order service associates the call with a global transaction. You do this by using the ATMI begin-transaction function before issuing the service request, and issuing the commit-transaction function after it. Because the service is invoked as part of a global transaction, its work is done on its behalf. The server is propagated with the client's transaction when the Place Order service is invoked. Both the database access and the enqueue operation to the shipping application queue become part of the client's transaction.

Should either operation fail because of an application or system error, the work done in the transaction is rolled back to its state at the outset of the transaction. If both succeed, however, the client's call to commit the transaction causes the effects of the database update and the enqueued message to become permanent records of this transaction.

Modifying the UBBCONFIG File to Accommodate Transactions

You must modify the RESOURCES, MACHINES, GROUPS, and the SERVICES sections of the application's UBBCONFIG file in the following way to accommodate transactions:

Specifying Application-Wide Transactions in the RESOURCES Section

The following table provides a description of transaction-related parameters in the RESOURCES section of the configuration file.

Parameter Meaning
MAXGTT Limits the total number of global transaction identifiers (GTRIDs) allowed on one machine at one time. The maximum value allowed is 2048, minimum 0, and default 100. You can override this value on a per-machine basis in the MACHINES section.

Entries remain in the table only while the global transaction is active, so this parameter has the effect of setting a limit on the number of simultaneous transactions.

CMTRET Specifies the initial setting of the TP_COMMIT_CONTROL characteristic. The default is COMPLETE. Following are its two settings:

Creating a Transaction Log (TLOG)

This section discusses creating a TLOG.

Creating the UDL

The Universal Device List (UDL) is like a map of the BEA TUXEDO file system. The UDL gets loaded into shared memory when an application is booted. The TLOG refers to a log in which information on transactions is kept until the transaction is completed.To create an entry in the UDL for the TLOG device, create the UDL on each machine using global transactions. If the TLOGDEVICE is mirrored between two machines, it is unnecessary to do this on the paired machine. The Bulletin Board Liaison (BBL) then initializes and opens the TLOG during the boot process.

To create the UDL, enter a command using the following format, before the application has been booted:

tmadmin -c crdl -z config -b blocks

In the preceding format statement, specify in the -z config argument the full path name for the device where you should create the UDL. Specify in the -b blocks argument the number of blocks to be allocated on the device. config should match the value of the TLOGDEVICE parameter in the MACHINES section of the UBBCONFIG file.

Note: In general, the value that you supply for blocks should not be less than the value for TLOGSIZE. For example, if TLOGSIZE is specified as 200 blocks, specifying -b 500 would not cause a degradation.

For more information about storing the TLOG, see the BEA TUXEDO Installation Guide.

Defining Transaction-related Parameters in the MACHINES Section

You can define a global transaction log (TLOG) using several parameters in the MACHINES section of the UBBCONFIG file. You must manually create the device list entry for the TLOGDEVICE on each machine where a TLOG is needed. You can do this either before or after TUXCONFIG has been loaded, but it must be done before the system is booted.

The following table provides a description of transaction-related parameters in the MACHINES section of the configuration file.

Parameter Meaning
TLOGNAME The name of the DTP transaction log for this machine.
TLOGDEVICE Specifies the BEA TUXEDO file system that contains the DTP transaction log (TLOG) for this machine. If this parameter is not specified, the machine is assumed not to have a TLOG. The maximum string value length is 64 characters.
TLOGSIZE The size of the TLOG file in physical pages. Its value must be between 1 and 2048, and its default is 100. The value should be large enough to hold the number of outstanding transactions on the machine at a given time. One transaction is logged per page. The default should be enough for most applications.
TLOGOFFSET Specifies the offset in pages from the beginning of TLOGDEVICE to the start of the VTOC that contains the transaction log for this machine.The number must be greater than or equal to 0 and less than the number of pages on the device. The default is 0.

TLOGOFFSET is rarely necessary. However, if two VTOCs share the same device or if a VTOC is stored on a device (such as a file system) that is shared with another application, you can use TLOGOFFSET to indicate a starting address relative to the address of the device.

Creating the Domains Transaction Log

You can create the Domains transaction log before starting the Domains gateway group by using dmadmin(1) crdmlog (crdlog) -d local_domain_name. Create the Domains transaction log for the named local domain on the current machine (that is, the machine where dmadmin is running). The command uses the parameters specified in the DMCONFIG file. This command fails if the named local domain is active on the current machine or if the log already exists. If the transaction log has not been created, the Domains gateway group creates the log when the Domains gateway group starts.

Defining Each Resource Manager (RM) and the Transaction Manager Server in the GROUPS Section

Additions to the GROUPS section fall into two categories:

Sample of the GROUPS Section

The following is an example from the GROUPS section in the banking application, called bankapp.

BANKB1 GRPNO=1 TMSNAME=TMS_SQL TMSCOUNT=2
OPENINFO="TUXEDO/SQL:<APPDIR>/bankdl1:bankdb:readwrite"

Description of Transaction Values in the Sample GROUPS Section

The following table describes the transaction values shown in the sample GROUPS section.

Transaction Value Meaning
BANKB1 GRPNO=1 TMSNAME=TMS_SQL\ TMSCOUNT=2 Contains the name of the transaction manager server (TMS_SQL), and the number (2) of these servers to be booted in the group BANKB1
TUXEDO/SQL Published name of the resource manager
<APPDIR>/bankdl1 Includes a device name
bankdb Database name
readwrite Access mode

Characteristics of the TMSNAME, TMSCOUNT, OPENINFO, and CLOSEINFO Parameters

The following table lists the characteristics of the TMSNAME, TMSCOUNT, OPENINFO, and CLOSEINFO parameters.

Parameter Characteristics
TMSNAME Name of the transaction manager server executable.

Required parameter for transactional configurations.

TMS is a null transactional manager server.

TMSCOUNT Number of transaction manager servers (must be between 2 and 10).

Default is 3.

OPENINFO, CLOSEINFO Represents information to open or close a resource manager.

Content depends on the specific resource manager.

Starts with the name of the resource manager.

Omission means the RM needs no information to open.

Characteristics of the AUTOTRAN, TRANTIME, and FACTORYROUTING Parameters

The following table lists the characteristics of the AUTOTRAN, TRANTIME, and FACTORYROUTING parameters.

Parameter Characteristics
AUTOTRAN Makes an interface the initiator of a transaction.

To work properly, may be dependent on personal communication between the system designer and the system administrator. If the administrator sets this value to Y without prior knowledge of the ICF parameters set by the developer, the actual run-time effort of the parameter might be unknown.

If a transaction already exists, a new one is not started.

Default is N.

TRANTIME Represents the timeout for the AUTOTRAN transactions.

Valid values are between 0 and 231 - 1, inclusive.

0 represents no timeout.

Default is 30 seconds.

FACTORYROUTING Points to an entry in the ROUTING section where data-dependent routing is specified for transactions that request this service.

Enabling a Service to Begin a Transaction in the SERVICES Section

The following are three transaction-related additions in the SERVICES section:

Characteristics of the AUTOTRAN, TRANTIME, and ROUTING Parameters

The following table lists the characteristics of the AUTOTRAN, TRANTIME, and ROUTING parameters.

Parameter Characteristics
AUTOTRAN Makes a service the initiator of a transaction.

Relieves the client of the transactional burden.

If a transaction already exists, a new one is not started.

Default is N.

TRANTIME Represents the timeout for the AUTOTRAN transactions.

Valid values are between 0 and 231 - 1, inclusive.

0 represents no timeout.

Default is 30 seconds.

ROUTING Points to an entry in the ROUTING section where data-dependent routing is specified for transactions that request this service.

Modifying the Domain Configuration File to Support Transactions

To enable transactions across domains, you need to set parameters in both the DM_LOCAL_DOMAINS and the DM_REMOTE_SERVICES sections of the Domains configuration file (DMCONFIG). Entries in the DM_LOCAL_DOMAINS section define local domain characteristics. Entries in the DM_REMOTE_SERVICES section define information on services that are imported and that are available on remote domains.

Characteristics of the DMTLOGDEV, DMTLOGNAME, DMTLOGSIZE, MAXRDTRAN, and MAXTRAN Parameters

The DM_LOCAL_DOMAINS section of the Domains configuration file identifies local domains and their associated gateway groups. This section must have an entry for each gateway group (Local Domain). Each entry specifies the parameters required for the Domains gateway processes running in that group.

The following table provides a description of the five transaction-related parameters in this section: DMTLOGDEV, DMTLOGNAME, DMTLOGSIZE, MAXRDTRAN, and MAXTRAN.

Parameter Characteristics
DMTLOGDEV Specifies the BEA TUXEDO file system that contains the Domains transaction log (DMTLOG) for this machine. The DMTLOG is stored as a BEA TUXEDO VTOC table on the device. If this parameter is not specified, the Domains gateway group is not allowed to process requests in transaction mode. Local domains running on the same machine can share the same DMTLOGDEV file system, but each local domain must have its own log (a table in the DMTLOGDEV) named as specified by the DMTLOGNAME keyword.
DMTLOGNAME Specifies the name of the Domains transaction log for this domain. This name must be unique when the same DMTLOGDEV is used for several local domains. If a value is not specified, the value defaults to the string DMTLOG. The name must contain 30 characters or less.
DMTLOGSIZE Specifies the numeric size of the Domains transaction log for this machine (in pages). It must be greater than zero and less than the amount of available space on the BEA TUXEDO file system. If a value is not specified, the value defaults to 100 pages.

Note: The number of domains in a transaction determine the number of pages you must specify in the DMTLOGSIZE parameter. One transaction does not necessarily equal one log page.

MAXRDTRAN Specifies the maximum number of domains that can be involved in a transaction. It must be greater than zero and less than 32,768. If a value is not specified, the value defaults to 16.
MAXTRAN Specifies the maximum number of simultaneous global transactions allowed on this local domain. It must be greater than or equal to zero, and less than or equal to the MAXGTT parameter specified in the TUXCONFIG file. If not specified, the default is the value of MAXGTT.

Characteristics of the AUTOTRAN and TRANTIME Parameters

The DM_REMOTE_SERVICES section of the Domains configuration file identifies information on services imported and available on remote domains. Remote services are associated with a particular remote domain.

The following table describes the two transaction-related parameters in this section: AUTOTRAN and TRANTIME.

Parameter Characteristics
AUTOTRAN Used by gateways to automatically start/terminate transactions for remote services. This capability is required if you want to enforce reliable network communication with remote services. You specify this capability by setting the AUTOTRAN parameter to Y in the corresponding remote service definition.
TRANTIME Specifies the default timeout value in seconds for a transaction automatically started for the associated service. The value must be greater than or equal to zero, and less than 2147483648. The default is 30 seconds. A value of zero implies the maximum timeout value for the machine.

Example: A Distributed Application Using Transactions

The following configuration file shows bankapp as an application that is distributed over three sites and that uses transactions. The application includes the following:

The file includes seven sections: RESOURCES, MACHINES, GROUPS, NETWORK, SERVERS, SERVICES, and ROUTING.

The RESOURCES Section

The RESOURCES section shown in Listing 7-1 specifies the following parameters:

The MACHINES Section

The MACHINES section shown in Listing 7-2 specifies the following parameters:

The GROUPS and NETWORK Sections

The GROUPS and NETWORK sections shown in Listing 7-3 specify the following parameters:

The SERVERS, SERVICES, and ROUTING Sections

The SERVERS, SERVICES, and ROUTING sections shown in Listing 7-4 specify the following parameters:



[Top] [Previous Page] [Next Page] [Bottom]