Created
March 6, 2022 17:20
-
-
Save aidangannon/84964f964f119cf146a49d6f7e333e45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# transaction 1 | |
START TRANSACTION; | |
LOCK TABLE User IN EXCLUSIVE MODE; | |
INSERT INTO User (Name, Dob, Age) VALUES ('John', '10-10-1999', 24); | |
UNLOCK TABLE User; | |
COMMIT; | |
# transaction 2 | |
START TRANSACTION; | |
SELECT * FROM User WHERE ID = '1bd76753-f391-453d-bd98-a212789dd652' FOR UPDATE; | |
INSERT INTO User (Name, Dob, Age) VALUES ('Jason', '9-9-1998', 32); | |
COMMIT; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
deadlock code, for oracle DB...