2.9.2 Transaction isolation levels supported by HADB
HADB supports the following transaction isolation levels:
-
READ COMMITTED
-
REPEATABLE READ
- Organization of this subsection
(1) READ COMMITTED
Data that has already been committed when an SQL statement is executed (when a cursor is opened for retrieval) becomes the processing target of the SQL statement. Therefore, if the same SELECT statement is executed multiple times within the same transaction, data updating by another transaction might cause the execution result of the SELECT statement to vary.
(2) REPEATABLE READ
If the same SQL statement with the same search condition is executed repeatedly within a transaction for which the REPEATABLE READ isolation level is set, the data that becomes the processing target of that SQL statement is always the same regardless of any processing by other transactions.
The data to be processed by the SQL statement changes according to the conditions shown in the following tables.
No. |
Chunks that store data |
Data to be processed by an SQL statement |
---|---|---|
1 |
|
For details, see Table 2‒10: Relationship between a transaction that updated the data within a chunk and the data to be processed by an SQL statement. |
2 |
Non-archived chunk that was created when the adbimport command, which uses the background-import facility, was executed in a local transaction |
None# |
- #
-
If the following two commands are executed in a local transaction, the data to be processed by SQL statements changes as shown in Table 2‒9: Relationship between chunks that store data and the data to be processed by an SQL statement and Table 2‒10: Relationship between a transaction that updated the data within a chunk and the data to be processed by an SQL statement.
-
The adbimport command, which uses the background-import facility
-
The adbmergechunk command, which merges multiple chunks, including the chunk created during execution of the adbimport command
The following figure shows an example.
Figure 2‒34: Changes in the data to be processed by the local transaction in connection with command execution -
No. |
Transaction that updated the data within a chunk |
Data that becomes the processing target of the SQL statement |
|
---|---|---|---|
1 |
Local transaction |
All data |
|
2 |
Other transaction |
Updating with an SQL statement:
|
Data that had already been committed when the local transaction started |
3 |
Adding data with the adbimport command |
Data when the adbimport command terminates normally |
|
4 |
Updating with the PURGE CHUNK statement |
Data when the PURGE CHUNK statement terminates normally |
|
5 |
Updating with the TRUNCATE TABLE statement |
Data when the TRUNCATE TABLE statement terminates normally |
|
6 |
Changing the chunk status with the adbchgchunkstatus command |
Data when the adbchgchunkstatus command terminates normally |
- Important
-
If a retrieval with a chunk ID specified (for example, the #GETDATA subcommand of the adbsql command) is executed, the transaction isolation level might not become REPEATABLE READ. For details, see (4) Chunks that are retrieved during execution of the adbmergechunk command in 11.4.9 Merging chunks (to reduce the number of chunks).