Home & Garden Personal Safety & Security

What Is Locks in SQL?

    Shared Locks (S)

    • A shared lock holds data for a single user to read. Others users cannot modify data that is held under a shared lock, but they are able to read the data. Once the data has been read, the lock is generally relinquished, with some exceptions such as if the transaction is run using the READCOMMITTED or READCOMMITTEDLOCK locking isolation level. Shared locks are used in read-only operations only, and cannot be used to modify the data.

    Exclusive Locks (X)

    • An exclusive lock is used to prevent a section of data that is being modified by a transaction from being modified by another transaction. By default, data under an exclusive lock cannot be read by anyone other than the locker, however this setting can be changed by using the NOLOCK hint or a READUNCOMMITTED isolation level. This type of lock would be used with operations such as INSERT, UPDATE and DELETE.

    Update Locks (U)

    • An update lock sits in the middle-ground between a shared lock and an exclusive lock. If some data has an exclusive lock on it, no other lock can be placed on it. An update lock can be placed on a lock which already has a shared lock on it; and when it comes time to make updates to the data, the update lock changes into an exclusive lock. Only one update lock can be placed onto a resource at any given time.

    Intent Locks (I)

    • An intent lock allows a transaction to notify another transaction of its intent to lock the data -- hence the name "Intent lock." They work preventing transactions from locking another transactions from locking a higher part of the database. For example, placing an intent lock on the table prevents another transaction from placing an exclusive lock the table, which would cancel a lock on a lower part such as a row or a page.

    Schema Locks (Sch) and Bulk Update Locks (BU)

    • Schema locks are used with an operation that requires the schema of the table is running. There are two kinds -- a schema stability lock (Sch-S), which does not block access to the object data, and a schema modification lock, which does block access to the object data. A Bulk update lock, as the name implies, is used by bulk operations such as bulk-copying data, and when the TABLOCK hint has been specified.

SHARE
RELATED POSTS on "Home & Garden"
Energy-Saving Tips for Your Home
Energy-Saving Tips for Your Home
Using Video Surveillance System for Effective Monitoring
Using Video Surveillance System for Effective Monitoring
Facing Electrical Problems – Contact a Reliable San Diego Electrician
Facing Electrical Problems – Contact a Reliable San Diego Electrician
How to Get Rid of Black Stuff That Adheres to a Toilet Tank
How to Get Rid of Black Stuff That Adheres to a Toilet Tank
How to Build a Martial Arts Belt Display
How to Build a Martial Arts Belt Display
DIY Rodent Extermination
DIY Rodent Extermination
How to Remove Goo Gone Stains From Clothing
How to Remove Goo Gone Stains From Clothing
Universal Solar Products
Universal Solar Products
Reliable Attributes Of A Multi-functional Led Light Bar
Reliable Attributes Of A Multi-functional Led Light Bar
Types of Energy-Saving Light Bulbs
Types of Energy-Saving Light Bulbs
Components of an Intrusion Detection System
Components of an Intrusion Detection System
How to Light Soy Wickless Candles
How to Light Soy Wickless Candles
How to Kill Scorpions
How to Kill Scorpions
Tips To Keep Your Home Safe From Fire During The Holidays (and Year-round)
Tips To Keep Your Home Safe From Fire During The Holidays (and Year-round)
How to Kill a Rat in the Subfloor
How to Kill a Rat in the Subfloor
Wireless Gate Intercom - Why it is Best For Your Home and Business
Wireless Gate Intercom - Why it is Best For Your Home and Business
Choosing Right Fire Protection Can Prevent a Tragedy
Choosing Right Fire Protection Can Prevent a Tragedy
How to Compare Alarm System Monthly Service Fees
How to Compare Alarm System Monthly Service Fees
Learn How To Set Up Your Home Security Camera Equipment At Home
Learn How To Set Up Your Home Security Camera Equipment At Home
Protect Your Home With Reputable Wichita Locksmith Service
Protect Your Home With Reputable Wichita Locksmith Service
Homemade Natural Room Freshener
Homemade Natural Room Freshener

Leave Your Reply

*