Sql server® 2012 t-sql fundamentals


Lock Modes and Compatibility



Download 10,93 Mb.
Pdf ko'rish
bet338/443
Sana26.01.2022
Hajmi10,93 Mb.
#411755
1   ...   334   335   336   337   338   339   340   341   ...   443
Bog'liq
BookSQL

Lock Modes and Compatibility

As you start learning about transactions and concurrency, you should first familiarize yourself with 

two main lock modes—exclusive and shared

When you try to modify data, your transaction requests an exclusive lock on the data resource, 

regardless of your isolation level (you’ll learn more about isolation levels later in this chapter). If 

granted, the exclusive lock is held until the end of the transaction. For single-statement transactions

this means that the lock is held until the statement completes. For multistatement transactions, this 

means that the lock is held until all statements complete and the transaction is ended by a COMMIT 



TRAN or ROLLBACK TRAN command. 

Exclusive locks are called “exclusive” because you cannot obtain an exclusive lock on a resource if 

another transaction is holding any lock mode on the resource, and no lock mode can be obtained on 

a resource if another transaction is holding an exclusive lock on the resource. This is the way modi-

fications behave by default, and this default behavior cannot be changed—not in terms of the lock 

mode required to modify a data resource (exclusive) and not in terms of the duration of the lock (until 

the end of the transaction). In practical terms, this means that if one transaction modifies rows, until 

the transaction is completed, another transaction cannot modify the same rows. However, whether 

another transaction can read the same rows or not depends on its isolation level.

www.it-ebooks.info





Download 10,93 Mb.

Do'stlaringiz bilan baham:
1   ...   334   335   336   337   338   339   340   341   ...   443




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish