Skip to content

Instantly share code, notes, and snippets.

@b4284
Created April 30, 2015 18:36
Show Gist options
  • Save b4284/74a6ed59b20f76c893ce to your computer and use it in GitHub Desktop.
Save b4284/74a6ed59b20f76c893ce to your computer and use it in GitHub Desktop.
Connection A:
test=> begin;
BEGIN
test=> update test set foo = 2 where id = 1;
UPDATE 1
test=> end;
COMMIT
Connection B:
test=> begin transaction isolation level repeatable read;
BEGIN
test=> update test set foo = 3 where id = 1;
錯誤: 因為並行更新,無法序列化存取
test=> end;
ROLLBACK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment