Tuesday, March 27, 2012

deadlocked on lock

What can I do to prevent this type of error messages occuring? Theese errros
are coming basicly from readonly database transaction. One part of our
massageboard on IIS. What causes this erros to occur? There is quite a lot
of insertrs and updates happening at the same time users are reading thos
message board pages... But this page is read only.
Transaction (Process ID 125) was deadlocked on lock resources with another
process and has been chosen as the deadlock victim. Rerun the transaction.TLehtinen wrote:
> What can I do to prevent this type of error messages occuring? Theese
> errros are coming basicly from readonly database transaction. One
> part of our massageboard on IIS. What causes this erros to occur?
> There is quite a lot of insertrs and updates happening at the same
> time users are reading thos message board pages... But this page is
> read only.
> Transaction (Process ID 125) was deadlocked on lock resources with
> another process and has been chosen as the deadlock victim. Rerun the
> transaction.
- Minimize yout transaction duration - do not leave any transactions
open on a client - BEGIN TRAN... Exec T-SQL... COMMIT TRAN as quickly as
possible
- When you delete, insert or update from tables make sure to access
tables in the same order in all procedures
- Use Profiler to help determine your long running SQL statements - add
indexes where needed to address performance concerns
- If all else fails, consider using a NOLOCK hint on your SELECT
statements, assuming your application can deal with the possibility of
dirty reads
Here's more information:
http://www.sql-server-performance.com/deadlocks.asp
David Gugick - SQL Server MVP
Quest Softwaresql

No comments:

Post a Comment