Skip to content

Commit 4aadcab

Browse files
committed
transaction repeatable read lock
1 parent d68f63a commit 4aadcab

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ At the beginning, it was the repository with questions from Java interviews. Cur
301301
- [What are possible options for implementing transactions in microservices](transaction.md#what-are-possible-options-for-implementing-transactions-in-microservices)
302302
- [What is the difference between optimistic and pessimistic locking?](transaction.md#what-is-the-difference-between-optimistic-and-pessimistic-locking)
303303
- [Is it possible to use transaction for select statements?](transaction.md#is-it-possible-to-use-transaction-for-select-statements)
304+
- [What locks are made in the case of using Repeatable Read isolation level?](transaction.md#what-locks-are-made-in-the-case-of-using-repeatable-read-isolation-level)
304305

305306
## RabbitMQ
306307
- [What is RabbitMQ?](rabbitmq.md#what-is-rabbitmq)

transaction.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- [What are possible options for implementing transactions in microservices](#what-are-possible-options-for-implementing-transactions-in-microservices)
88
- [What is the difference between optimistic and pessimistic locking?](#what-is-the-difference-between-optimistic-and-pessimistic-locking)
99
- [Is it possible to use transaction for select statements?](#is-it-possible-to-use-transaction-for-select-statements)
10+
- [What locks are made in the case of using Repeatable Read isolation level?](#what-locks-are-made-in-the-case-of-using-repeatable-read-isolation-level)
1011

1112
## What is transaction?
1213
A **transaction** is a sequence of operations performed (using one or more SQL statements) on a database as a single logical unit of work. The effects of all the SQL statements in a transaction can be either all committed (applied to the database) or all rolled back (undone from the database). A database transaction must be atomic, consistent, isolated and durable.
@@ -66,4 +67,7 @@ If that is a situation that could occur in your application you should use a tra
6667
###### Relative links:
6768
+ https://stackoverflow.com/questions/5982517/use-transactions-for-select-statements
6869

70+
## What locks are made in the case of using Repeatable Read isolation level?
71+
The transaction holds read locks on all rows it references and writes locks on all rows it inserts, updates, or deletes. Since other transaction cannot read, update or delete these rows, consequently it avoids non-repeatable read.
72+
6973
[Home Page](README.md)

0 commit comments

Comments
 (0)