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. General Programming
  3. C#
  4. ThreadAbortException and SQL?

ThreadAbortException and SQL?

Scheduled Pinned Locked Moved C#
databasequestion
4 Posts 3 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.
  • K Offline
    K Offline
    Kuira
    wrote on last edited by
    #1

    I am using a Thread.Abort to abort an SQL command when the user wants to stop the current execution of an SQL Command. However, it seems to take a while for the ThreadAbortException to start up and cancelling the current execution. So I am wondering what takes place when the Thread.Abort that makes the SQL takes about 10-15 seconds to allow it to go towards the ThreadAbortException. -- modified at 22:56 Thursday 23rd February, 2006

    S L 2 Replies Last reply
    0
    • K Kuira

      I am using a Thread.Abort to abort an SQL command when the user wants to stop the current execution of an SQL Command. However, it seems to take a while for the ThreadAbortException to start up and cancelling the current execution. So I am wondering what takes place when the Thread.Abort that makes the SQL takes about 10-15 seconds to allow it to go towards the ThreadAbortException. -- modified at 22:56 Thursday 23rd February, 2006

      S Offline
      S Offline
      S Senthil Kumar
      wrote on last edited by
      #2

      ThreadAbort can abort threads only when they are running managed code. When you called the method to abort the command, it probably was executing unmanaged code. Regards Senthil _____________________________ My Blog | My Articles | WinMacro

      1 Reply Last reply
      0
      • K Kuira

        I am using a Thread.Abort to abort an SQL command when the user wants to stop the current execution of an SQL Command. However, it seems to take a while for the ThreadAbortException to start up and cancelling the current execution. So I am wondering what takes place when the Thread.Abort that makes the SQL takes about 10-15 seconds to allow it to go towards the ThreadAbortException. -- modified at 22:56 Thursday 23rd February, 2006

        L Offline
        L Offline
        Le centriste
        wrote on last edited by
        #3

        This is a brutal way to cancel a SQL command. Ever considered trying SqlCommand.Cancel? -------- "I say no to drugs, but they don't listen." - Marilyn Manson

        K 1 Reply Last reply
        0
        • L Le centriste

          This is a brutal way to cancel a SQL command. Ever considered trying SqlCommand.Cancel? -------- "I say no to drugs, but they don't listen." - Marilyn Manson

          K Offline
          K Offline
          Kuira
          wrote on last edited by
          #4

          to do the SqlCommand.Cancel you probably would put that on ThreadAbortException............

          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