Nonstop Database, HiRDB Version 9 UAP Development Guide
The multi-connection facility establishes multiple connections to the HiRDB server from one UAP process in a HiRDB client.
The multi-connection facility establishes independent individual connections. A separate server process is allocated to each connection, and the connections are processed as separate transactions. The UAP can, therefore, execute multiple SQL statements simultaneously. Because multiple connections can be established from one UAP, the number of UAPs to be executed can be reduced, and the overall memory requirement for UAPs can be reduced.
Because each connection is counted as a separate user, the maximum number of server connections becomes the maximum number of simultaneous connections rather than the maximum number of users.
The multi-connection facility has the following characteristics:
When the multi-connection facility is used in the X/Open XA interface environment, a UAP operating under a single transaction manager (such as OpenTP1) can use the XA interface to access multiple HiRDB systems. Because the UAP is using the XA interface, the UAP can synchronize and control processing among transactions that access multiple HiRDB systems.
For the open character string to be specified in the xa_open() function, specify the name of the file in which the environment variables (client environment definitions) were set. The xa_open() function establishes a connection to HiRDB according to those environment variables. You can select the destination to which an SQL statement is issued from among the connection destinations connected by the xa_open() function.
The multi-connection facility in the X/Open XA interface environment can be used only with the following client platforms:
Figures 4-59 through 4-63 show an overview of multi-connection facility processing.
Figure 4-59 Overview of multi-connection facility processing (when multithreading is not used)
Figure 4-60 Overview of multi-connection facility processing (when multithreading is used)
Figure 4-61 Overview of multi-connection facility processing (when a connection is shared by multiple threads)
Figure 4-62 Overview of multi-connection facility processing (when an AP uses an X/Open-compliant API in a single-thread OLTP system)
Figure 4-63 Overview of multi-connection facility processing (when an AP uses an X/Open-compliant API in a multi-thread OLTP system)
Figures 4-64 and 4-65 show coding examples of UAPs that use the multi-connection facility.
Figure 4-64 Coding example (C) of a UAP that uses the multi-connection facility
Figure 4-65 Coding example (COBOL) of a UAP that uses the multi-connection facility
Figures 4-66 and 4-67 show coding examples in which the multi-connection facility is used by UAPs that use an X/Open-compliant API under OLTP.
Figure 4-66 Coding example (C) in which the multi-connection facility is used by a UAP that uses an X/Open-compliant API under OLTP
Figure 4-67 Coding example (COBOL) in which the multi-connection facility is used by a UAP that uses an X/Open-compliant API under OLTP
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.