Deadlocks in database testing

Hi All,

While executing one of my scripts with 20 concurrent users, The transactions are getting failed and throwing error

Action.c(11992): Error: Server error msg (Number=1205, Severity=13, State=45, Function=dbsqlexec, Server="XXXXX", Procedure="rsp_ProcedureName", Line=33): Due to deadlock.

If i increase think time to 20 sec (multiply think time by 20; The script has a think time of 1 sec after each transaction and none inside it) the dead lock error is not thrown.

Is this a development issue or i need to handle this at script. The procedure is just selecting identity column from a table with where conditions. Thus i am a bit spectacle over here
  • Can you please provide more information about the Procedure/Steps you recorded. Just a guess, are all the users running the script is selecting the same record? If yes, then you can modify the script in such a manner that every user is working with unique selection. You might be getting deadlock with less think time because all the users works on same records at same time which may not be happening in case of 20 sec think time as the max allowed limit for users to work on same record is not reached...
  • Do u have access to the application log, if u have then check it then u will be able to know what is the main issue, more whatever description u have given, that looks like a application/DB design issue, more specifically application issue, application is not allowing to access the same data at the same time, which is wrong and that should be rectified.

  • When application code is modified to select with (NOLOCK), the deadlocks are not present. Also scripts are dealing with random records.