8.2.4 Transaction transfer

For a UAP that connects to HiRDB using the HiRDB XA library, you can execute transaction commit processing by a process other than the one used at the time the UAP accessed HiRDB. This is called transaction transfer. Figure 8-6 provides an overview of transaction transfer.

Figure 8-6 Overview of transaction transfer

[Figure]

Advantages
When transaction transfer is used, the transaction manager's UAP processing can accept the next service request without having to wait for transaction completion. This makes it possible to execute a UAP with fewer processes. However, the number of server processes used by HiRDB and the number of lock-release waits* may increase.
* Compared to when transaction transfer is not used, accesses to HiRDB for the next service request are more likely to be placed in lock-release wait status until the transaction is completed.
Criteria
When the transaction manager is to use the transaction transfer function, HiRDB must also use the transaction transfer function.
When the transaction manager is not to use the transaction transfer function, HiRDB must not use the transaction transfer function.
The following should be noted when the transaction manager can set whether or not the transaction transfer function is to be used:
  • The transaction transfer function should be used when the UAP processing workload is greater than the HiRDB access workload.
Operating procedure
To use this function, 1 must be set in the PDXAMODE operand of the client environment definition; to not use this function, either 0 must be set in this operand or specification of the operand must be omitted.
For details about the PDXAMODE operand, see the manual HiRDB Version 8 UAP Development Guide.
Notes
  1. If the information indicating whether or not the transaction transfer function is to be used does not match between the transaction manager and HiRDB, transactions may not be settled, HiRDB may terminate abnormally, or control may be returned to the transaction manager with an error.
  2. When this function is used, the scope of LOCK TABLE UNTIL DISCONNECT in the LOCK statement changes. For details about the scope of LOCK TABLE UNTIL DISCONNECT, see the manual HiRDB Version 8 UAP Development Guide.
Organization of this subsection
(1) OpenTP1 used as the transaction manager

(1) OpenTP1 used as the transaction manager

When this function is used, HiRDB supports OpenTP1's commit optimization and prepare optimization. Therefore, this function should be used when the -d option is omitted from OpenTP1's trnstring operand. When the -d option is specified, this function should not be used.

However, depending on conditions, as shown in Table 8-3, HiRDB can be set to not use the transaction transfer function even when OpenTP1 is set to use the transaction transfer function (to not suppress commit optimization or prepare optimization). Table 8-3 shows the relationship between the trnstring operand in the transaction service definition of the OpenTP1 system definition and the PDXAMODE operand for HiRDB.

Table 8-3 Relationship between OpenTP1's trnstring operand and HiRDB's PDXAMODE operand

ConditionPDXAMODE operand value
trnstring operand specificationStatus of OpenTP1 system
-d option omittedIn the same OpenTP1 system, global transaction consists of only one AP.0 or 1
In the same OpenTP1 system, global transaction consists of multiple APsOnly one AP is linked to the HiRDB XA library0 or 1
Multiple APs are linked to the HiRDB XA library1
-d option specified[Figure]0
Legend:
[Figure]: Not applicable
Note
  • If the trnstring operand's value does not match the PDXAMODE operand's value, HiRDB cannot settle transactions. In this case, HiRDB returns to OpenTP1 an XA function error return code (-6).
  • The -d option is supported by TP1/Server Base Version 03-03 or subsequent.

For details about the trnstring operand, see the manual OpenTP1 System Definition. For details about commit optimization and prepare optimization, see the manual OpenTP1 Programming Guide.

The following criteria should be used to determine whether or not the transaction transfer function should be used in systems connected to OpenTP1 and HiRDB:

Criteria
The transaction transfer function should be used when the client UAPs and server UAPs satisfy the following conditions:
  1. Client UAPs and server UAPs are located in the same OpenTP1 system environment.
  2. Client UAPs and server UAPs are linked to the HiRDB XA library.
  3. Client UAPs and server UAPs access HiRDB.*
* This means that one of the following conditions is satisfied:
  1. SQL for accessing HiRDB is issued.
  2. Either process or nothing is specified in the trn_rm_open_close_scope operand in the transaction service definition/user service definition of the OpenTP1 system definition.