database - What lock type is used in READ COMMITTED isolation level? -
I have found a contradiction in a Wikipedia article and it is not certain where the fault is (or maybe I do it correctly Does not understand).
According to the level of isolation:
"In the level of this separation, lock-based concurrency control holds the DBMS implementation write locks (acquisition of selected data) / Strong> By the end of the transaction, but when the selection is conducted, the reading locks are released (hence the non-recurring reading event can be at this isolation level, as discussed below Is) "
Also read further Read level Rtibddh isolation:
Transaction 1:
select * from users where id = 1;
Transaction 2:
The age of SET users = 21 where ID = 1 is updated; COMMIT;
Transactions 1:
Select * From users where id = 1; COMMIT;
According to the first quote, a write-up lock should be taken after the first selection statement in 1 transaction. How to successfully write another transaction lock can get locked and committed if this lock type is considered exclusive? Does DBMS really keep the locks written on selected data?
Wikipedia is incorrect in two ways:
- This is an implementation description is. An RDBMS does not have to do this. Using snapshot isolation can be implemented at least without lock to read.
- I do not know that RDBMS receives writing locks for reading. This sentence is unclear.
Comments
Post a Comment