-
interview question on deal lock
Hi all,
Today , I wan to interview, one of the questions is
ho wto schedule can avoid dead lock.
1) a read lock on tabe T
2) opear a read lock on table T
3) write lock on table T
4) operate a write lock on table T
for my understand deal lock is two process, 1)lock table a , 2)also lock a, 1) wait 2 to release lock inorder to finish the job. and 2 wait 1 to realease to lock to finish his job. do read and write will has any deal lock.
how shoul dI answer this question?
Thnak you
________
Starcraft ii replays
Last edited by sql; 03-06-2011 at 01:51 AM.
-
In SQL Server read and write can get into deadlock. A read puts shared lock on a row during select (or during the whole transaction if serializable isolation level is used)
-
And deadlock can happen when two processes put lock on different tables that involved in both processes.
-
Hi, thank you . How to set aschedule to avoid deal lock.
-
You make sure that conflicting locks do not happen at the same time. So if you have batch jobs run them in the middle of the night when there are no online activities.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|