Skip to content

Commit 900edfc

Browse files
authoredDec 5, 2020
Deadlock
1 parent b2b9279 commit 900edfc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4080,7 +4080,7 @@ From Openjdk JEP359:
40804080

40814081
278. **[How to simulate a deadlock](https://github.com/AnghelLeonard/Hibernate-SpringBoot/tree/master/HibernateSpringBootDeadlockExample)**
40824082

4083-
**Description:** This application is an example of causing a database deadlock in MySQL. This application produces an exception of type: `com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction`. However, the database will retry until one of the transaction (A) succeeds.
4083+
**Description:** This application is an example of causing a database deadlock in MySQL. This application produces an exception of type: `com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction`. However, the database will retry until transaction (A) succeeds.
40844084

40854085
**Key points:**
40864086
- start *Transaction (A)* and trigger a `SELECT` with `PESSIMISTIC_WRITE` to acquire an exclusive lock to table `author`

0 commit comments

Comments
 (0)
Failed to load comments.