Hitachi

Hitachi Advanced Database Setup and Operation Guide


16.3.6 Creating client definitions

Create separate client definitions for application programs that execute only retrieval SQL statements, and application programs that also execute update SQL statements, by specifying different transaction access modes and transaction isolation levels. For example, if you are using the JDBC driver, change the specification of the transaction access mode and transaction isolation level in properties such as the system properties.

For details about how to create a client definition, see Creating a client definition in Setting Up an Environment for an HADB Client (If the ODBC Driver and CLI Functions Are Used) in the HADB Application Development Guide. For details about the operands in a client definition, see Contents of operands in the client definition under Designing Client Definitions in the HADB Application Development Guide.

■ Client definition specification example (for an application that executes only retrieval SQL statements)
set adb_clt_rpc_srv_host = 10.196.108.143     ...1
set adb_clt_rpc_srv_port = 23650              ...2
set adb_clt_ap_name = "AP01"                  ...3
set adb_clt_trn_access_mode = READ_ONLY       ...4
set adb_clt_trn_iso_lv = READ_COMMITTED       ...5

Explanation

  1. For the connection-destination host name, specify alias IP address 10.196.108.143, which is used for client-server communication.

  2. For the connection-destination port number, specify 23650, which is the value specified for the adb_rpc_port operand in the server definition.

  3. Specify an application identifier.

  4. Because this is an application that executes only retrieval SQL statements, specify READ_ONLY to set the transaction access mode to read-only.

  5. Specify READ_COMMITTED as the transaction isolation level.

As a result of the specifications in 4 and 5, the HADB server on the master node selects a node with a light load, and retrieval SQL statements are executed on that node.

■ Client definition specification example (for an application that also executes update SQL statements)
set adb_clt_rpc_srv_host = 10.196.108.143     ...1
set adb_clt_rpc_srv_port = 23650              ...2
set adb_clt_ap_name = "AP02"                  ...3
set adb_clt_trn_access_mode = READ_WRITE      ...4

Explanation

  1. For the connection-destination host name, specify alias IP address 10.196.108.143, which is used for client-server communication.

  2. For the connection-destination port number, specify 23650, which is the value specified for the adb_rpc_port operand in the server definition.

  3. Specify an application identifier.

  4. Because this is an application that also executes update SQL statements, specify READ_WRITE to set the transaction access mode to read/write. As a result, the SQL statements to be executed by this application are executed only on the master node.