How to cancel a long-running Database operation?

前端 未结 11 978
臣服心动
臣服心动 2020-11-30 04:18

Currently working with Oracle, but will also need a solution for MS SQL.

I have a GUI that allows users to generate SQL that will be executed on the database. This

11条回答
  •  青春惊慌失措
    2020-11-30 04:50

    You could have the background worker fire off the actual database call on a different thread, and then periodically check to see if either the database call has finished, or cancel has been pressed, at which point you could kill off the database thread. This wouldn't actually help the database load any (as your query has been sent and is still processing) but it does release your local resources related to it.

提交回复
热议问题