Deadlock part 1 -brief.

I already shared some of the great links for deadlock in my earlier blog here

got a question for my interview what is deadlock?, so would like to brief about it, following description would be deadlock by simple transactions which is very good for sql server 2000.

Deadlock in simple terms:

Deadlock contains:

>> Two or more sessions/processes
>> Locks(exclusive/Update lock)
>> both the session is running -Editing serially and trying to access each other after they are locked(update/exclusive).
>> Generally whenever we begin the trasaction and running lock query e.g. update (update lock) then we are locking that object…. so that way if we are having two sessions and both sessions are locking two tables respectively and now when one session tries to access session locked by other and ( this is blocking)…… finally when second session tries to access first which is already locked and waiting for first session to complete, so second session never could able to access data from table which is locked by first session(which is waiting for second sessions data)— cause deadlock.

Now in my next blog I would explain deadlock could also cause by Reindex,  these senario would be sql server 2005 and above. you can get these all information by my ealier blog link above. which has all the great experts link for reference.

Thanx.

Vinay

* I Blog whenever I learn something and also for my future understanding/reference.

Advertisements
This entry was posted in DeadLock, General, What I learned today and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s