Transaction and Lock - Lock View database

Which is to modify the database locking lock, or lock on the page, or lock on the table, to decide database

If you change are two records, two records in the lock, if you change a lot of bars, this time to a database to see a lock too cumbersome, easier way to lock the entire page, or to the entire table locking save more

The larger the locked level, the more easy database, the more easy database concurrency worse, modify a record to the table if coupled with an exclusive lock, then want to check other records have not inquired

Locked objects smaller, the better concurrency

The larger the locked object plus, the poorer the concurrency

This is just the beginning of several locks

 

1, open transaction modifies student's name, student number to 0000000001 for the student's name plus a '_01', the transaction is not submitted

 

 

2, to see which one line on the Student table plus an exclusive lock
ObjId: 2105058535 represent this table is Student
Type: RID representations are identified by row
Resource: 1: 567: 0, represents the first 576 of a data file line 1 of the
Mode: X represents an exclusive lock

3, open transaction modifies student's name, student number to 2 to take more than one lot is equal to that student's name plus a _01 0, the transaction is not submitted

 

4, see the Student table to add an exclusive lock
ObjId: 2105058535 represent this table is Student
Type: TAB is represented in Table
Mode: X represents an exclusive lock

 

Guess you like

Origin www.cnblogs.com/menglin2010/p/11847868.html