Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fd6df36

Browse files
authored
Update README.md
1 parent 577b6b7 commit fd6df36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,9 +1347,9 @@ begin
13471347
return;
13481348
end if;
13491349

1350-
-- важный момент с блокировкой для параллельных транзакций:
1350+
-- важный момент с блокировкой параллельных транзакций (они встают в очередь):
13511351
perform pg_advisory_xact_lock('order'::regclass::oid::int, new.client_id);
1352-
--perform from client c where c.id = new.client_id for update; -- или альтернативный вариант с блокировкой записи
1352+
--perform from client c where c.id = new.client_id for update; -- или альтернативный вариант с блокировкой записи, но более медленный, т.к. бликирует строку в таблице от изменений в параллельных транзакциях (они встают в очередь)
13531353

13541354
if (select count(*) from order o where o.client_id = new.client_id) > 5 then
13551355
/*

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /