Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How can your resolve deadlocks?

Answer Posted / ilgian

Deadlocks occour when two or more processes place a lock on
the same resources and each process waits for the others to
release the lock.
The options to avoid deadlocks are basically the following:
1) always update data in the same order: if process A
updates table t1 and then table t2 and process B updates
table t2 and then table t1 deadlocks can occour. Choose an
order and use it everywhere in your code.
2) issue the commands again when you catch the deadlock
3) always update data before data selection: no other
process will place a lock on the modified records
4) identify the processes that can run with lower deadlock
priority and issue SET DEADLOCK_PRIORITY LOW before these
statements: this will tell SQLServer that the process is a
good candidate for killing in case of deadlock, having
the "important" processes free to run without kills

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is nonclustered index on computed columns?

955


How important do you consider cursors or while loops for a transactional database?

962


What is difference between equi join and inner join?

950


Do you know what are different types of replication in sql server?

1098


What is used to replicate sessions between instances in coldfusion clusters?

1070


What are out-of-range errors with date and time literals?

1030


Why do we need different type of parameter?

1053


How to rename an existing table with the "sp_rename" stored procedure in ms sql server?

1030


Is mysql the same as sql server?

983


How to create database with physical files specified in ms sql server?

991


What is the impact on other user sessions when creating indexes?

923


What are different types of constraints?

920


Explain “@@rowcount” and “@@error” in sql server?

1086


How to call stored procedure using http soap?

1076


Give an example of SQL injection attack ?

1006