YugabyteDB поддерживает snapshot isolation
и serializable isolation
.
1 способ установить уровень изоляции на BEGIN
:
yb_demo=# begin transaction isolation level serializable;
BEGIN
yb_demo=# SHOW transaction_isolation;
transaction_isolation
-----------------------
serializable
(1 row)
yb_demo=# commit;
COMMIT
yb_demo=# SHOW transaction_isolation;
transaction_isolation
-----------------------
read committed
(1 row)
Другой способ - использовать оператор SET TRANSACTION
:
yb_demo=# begin;
BEGIN
yb_demo=# SHOW transaction_isolation;
transaction_isolation
-----------------------
read committed
(1 row)
yb_demo=# SET TRANSACTION ISOLATION LEVEL serializable;
SET
yb_demo=# SHOW transaction_isolation;
transaction_isolation
-----------------------
serializable
(1 row)
yb_demo=# commit;
COMMIT