27 Temmuz 2021 Salı

ACID - Serializable Nedir ?

Giriş
Şeklen şöyle

SQL Server için şeklen şöyle
 Açıklaması şöyle. Range içine yeni satır eklenemediği veya silinemediği için Phantom Read engellenir.
When T1 queries a range or records, it acquires a different type of lock, signifying that it belongs to the range.
This lock is called Range-lock, (Range S-S is its status) instead of S for Read lock and X for the Write lock.
So when T1 queries a range, all the rows are range-locked.
If T2 tries to insert a new row, which might affect this range, then T2 will be blocked until T1 completes and releases the Range lock.
However, T2 can read the rows, as Range-lock allowed shared reads, but prevents certain Writes.
Örnek - Spring
Şöyle yaparız
@Transactional(isolation = Isolation.SERIALIZABLE)

Hiç yorum yok:

Yorum Gönder