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.
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.
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:
-
Setting the transaction access mode to read-only mode
-
Setting the transaction isolation level to READ COMMITTED
The following table shows how to specify 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 |
|
|
2 |
Application that uses the ODBC driver |
|
|
3 |
Application that uses CLI functions |
|
|
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:
-
Transaction access mode
-
Transaction isolation level
-
Number of free threads
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.