Is it possible to stop sql query execution?

I want to ask if it is possible to stop the sql query while it is executing. I want to do this so that if someone else executes the same request at the same time, the application will not get stuck. I am using C # visual studio as the front end and oracle 11g as my back end.

+6
source share
3 answers

You can wrap the sql query in the pl / sql function and get the lock (with the dbms_lock package) before executing the select statement in the function / procedure (of course, you need to release the lock at the end). This way you can serialize the execution of this function.

Other options are the use of database jobs.

+2
source

What request do you make if this is a problem? Most likely, this can be optimized to solve any problem that you encounter.

This is not very realistic, because for each incoming request you will need to see if someone else is working with him first. This will create a lot of overhead and complexity in the system.

+1
source

Well, of course, you can kill QUERY query_id. To check the open mysql -u root -p console, do a long query and ctrl + c;), but well, I can’t think of any practical way to use it, keep track of requests that you could potentially kill, etc. But if you really need to save the world, you are likely to succeed

0
source

Source: https://habr.com/ru/post/895674/


All Articles