6.10.3 Notes on using the optimistic lock

This subsection describes the notes on using the optimistic lock.

Organization of this subsection
(1) Notes on the Version field settings
(2) Notes on using the lock method
(3) Exclusive control of clients in HiRDB

(1) Notes on the Version field settings

The notes on the Version field settings are as follows:

(2) Notes on using the lock method

The notes on using the lock method are as follows:

(3) Exclusive control of clients in HiRDB

The optimistic lock of Cosminexus JPA Provider is a locking method that assumes that the database Isolation level is accessed with Read Committed. If the database is HiRDB, the Isolation level is Repeatable Read by default; therefore, you must change the level to Read Committed.

Set the Isolation level for each client in the PDISLLVL parameter of the data guarantee level of the client environment variable. The default value is Repeatable Read (2). Therefore, change the value to Read Committed (1). An example of a change in setting is as follows:

Example of change: PDISLLVL=1

Specify the client environment variable in the value of the environmentVariables property with the config-property tag of the HITACHI Connector Property file or add the client environment variable in the configuration file for the client environment variable group of HiRDB.

If the data guarantee level of the client environment variable is operated with the default Repeatable Read, a lock is set in the shared mode. Therefore, note that if you combine the issue of reference series SQL such as the find method and the issue of update series SQL such as the flush method, a deadlock occurs easily.