Hitachi

Hitachi Advanced Database Setup and Operation Guide


16.5.3 Node that executes transactions

The node that executes transactions differs depending on the specified transaction access mode and transaction isolation level. The following table shows the relationship between a given transaction access mode and transaction isolation level, and the node that executes transactions.

Table 16‒7: Relationship between the transaction access mode and transaction isolation level, and the node that executes transactions

No.

Transaction access mode specification

Transaction isolation level specification

Node that executes transactions

1

Read/write mode

READ COMMITTED

Master node

2

REPEATABLE READ

3

Read-only mode

READ COMMITTED

Master node or slave node

4

REPEATABLE READ

Master node

The node that executes transactions is shown in the following figure.

Figure 16‒3: Node that executes transactions

[Figure]

In the case of an application program that executes only retrieval SQL statements, specifying the following settings can help effectively utilize the resources of slave nodes:

The following table shows how to specify the transaction access mode and transaction isolation level.

Table 16‒8: Specifying the transaction access mode and transaction isolation level

No.

Application type

Transaction access mode specification method

Transaction isolation level specification method

1

Application that uses the JDBC driver

  • adb_clt_trn_access_mode in the system properties

  • adb_clt_trn_access_mode in the user properties

  • adb_clt_trn_access_mode for the connection URL

  • setReadOnly method of the Connection interface

  • adb_clt_trn_iso_lv in the system properties

  • adb_clt_trn_iso_lv in the user properties

  • adb_clt_trn_iso_lv for the connection URL

  • setTransactionIsolation method of the Connection interface

2

Application that uses the ODBC driver

  • The adb_clt_trn_access_mode operand in the client definition

  • SQLSetConnectAttr() or SQLSetConnectAttrW()

  • The adb_clt_trn_iso_lv operand in the client definition

  • SQLSetConnectAttr() or SQLSetConnectAttrW()

3

Application that uses CLI functions

  • The adb_clt_trn_access_mode operand in the client definition

  • a_rdb_SQLSetConnectAttr()

  • The adb_clt_trn_iso_lv operand in the client definition

  • a_rdb_SQLSetConnectAttr()

For details about the specification method, see the HADB Application Development Guide.

Also note that the nodes executing transactions are automatically determined by the master node's HADB server based on the following factors:

Consequently, the executing node might change for every transaction. However, if the cursor is a holdable cursor, the executing node does not change while the cursor is open.

Important

When transactions in read/write mode, or some commands are currently being executed, transactions in read-only mode are also executed on the master node (slave nodes are not used). Therefore, to effectively utilize the resources of slave nodes, as far as possible make sure to finish transactions in read/write mode frequently on an individual basis, rather than in bulk.

For what is meant by "some commands", see (4) Restrictions on simultaneously executing commands with transactions in 2.19.2 Nodes on which transactions and commands are executed.