Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How to Solve Dead Lock problem in Sql Server 2005 Question

How to Solve Dead Lock problem in Sql Server 2005 Question

Scheduled Pinned Locked Moved Database
questionhelpcsharpdatabasesql-server
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pdnet
    wrote on last edited by
    #1

    Hi all, I am using Visual Studio 2008 and Sql Server 2005 I am use some CLR Programming in my windows application and it goes fine. But I got Some Error during Transaction in my application. Error : Transaction (Process ID 55) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. So, What is the Problem and How Can I Solve this Type of Problem. Thanking you very much.

    Arindam Banerjee Sr. Software Developer Rance Computer Pvt Ltd. Kolkata (India)

    W 1 Reply Last reply
    0
    • P pdnet

      Hi all, I am using Visual Studio 2008 and Sql Server 2005 I am use some CLR Programming in my windows application and it goes fine. But I got Some Error during Transaction in my application. Error : Transaction (Process ID 55) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. So, What is the Problem and How Can I Solve this Type of Problem. Thanking you very much.

      Arindam Banerjee Sr. Software Developer Rance Computer Pvt Ltd. Kolkata (India)

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      For deadlock descriptoin, see: - http://en.wikipedia.org/wiki/Deadlock[^] - Deadlock[^] In order to prevent a deadlock you must for example ensure that operations (and lock acquisitions) are executed in the same order, everywhere. This won't prevent all situations, but the amount will be much smaller.

      The need to optimize rises from a bad design. My articles[^]

      C J 2 Replies Last reply
      0
      • W Wendelius

        For deadlock descriptoin, see: - http://en.wikipedia.org/wiki/Deadlock[^] - Deadlock[^] In order to prevent a deadlock you must for example ensure that operations (and lock acquisitions) are executed in the same order, everywhere. This won't prevent all situations, but the amount will be much smaller.

        The need to optimize rises from a bad design. My articles[^]

        C Offline
        C Offline
        CH SRINIW8Z
        wrote on last edited by
        #3

        In your code check the exception, if it is sql exception, then instead of skipping the control, stop the process for some time and call the same functionality once again, by the time, other process will finish it's work and release the data, then you process will continue

        ch sriniw8z

        W 1 Reply Last reply
        0
        • C CH SRINIW8Z

          In your code check the exception, if it is sql exception, then instead of skipping the control, stop the process for some time and call the same functionality once again, by the time, other process will finish it's work and release the data, then you process will continue

          ch sriniw8z

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          I suppose you didn't actually want to answer my post, but the original question. When answering a question (or another post), press reply on the post which you want to answer or comment.

          The need to optimize rises from a bad design. My articles[^]

          1 Reply Last reply
          0
          • W Wendelius

            For deadlock descriptoin, see: - http://en.wikipedia.org/wiki/Deadlock[^] - Deadlock[^] In order to prevent a deadlock you must for example ensure that operations (and lock acquisitions) are executed in the same order, everywhere. This won't prevent all situations, but the amount will be much smaller.

            The need to optimize rises from a bad design. My articles[^]

            J Offline
            J Offline
            Jon_Boy
            wrote on last edited by
            #5

            True Dat! Easy to implement when the DB is new and there aren't that many queries, sps, etc. On an existing database with alot of objects, little hard to implement. Lack of fore thought will kill you later on a large database with deadlocks/delaylocks.

            Any suggestions, ideas, or 'constructive criticism' are always welcome. "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

            W 1 Reply Last reply
            0
            • J Jon_Boy

              True Dat! Easy to implement when the DB is new and there aren't that many queries, sps, etc. On an existing database with alot of objects, little hard to implement. Lack of fore thought will kill you later on a large database with deadlocks/delaylocks.

              Any suggestions, ideas, or 'constructive criticism' are always welcome. "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

              W Offline
              W Offline
              Wendelius
              wrote on last edited by
              #6

              That's true. One basic rule is to make operations top-down in relational order. It's quite simple rule of thumb, but works in many cases.

              The need to optimize rises from a bad design. My articles[^]

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups