简体   繁体   English

如何取消对oracle存储过程的调用?

[英]How to cancel call to oracle stored procedure?

I have a java application, which searches for some records in oracle on click of search button. 我有一个Java应用程序,单击搜索按钮可在oracle中搜索一些记录。 It calls stored procedures to search the data in oracle tables. 它调用存储过程以搜索oracle表中的数据。 Sometimes the search output is very large and takes a lot of time to process, I want to implement a cancel button so that the operation can be cancelled at any time. 有时搜索输出很大,并且需要很多时间来处理,我想实现一个取消按钮,以便可以随时取消该操作。 I thought of implementing separate thread in java but it wont solve the problem because the stored procedure is already called. 我曾考虑在Java中实现单独的线程,但由于已调用了存储过程,因此无法解决问题。 How can i achieve this? 我怎样才能做到这一点?

You should create another stored procedure which contains kill command to cancel running store procedure and call this new SP from your cancel button. 您应该创建另一个包含kill命令的存储过程,以取消正在运行的存储过程,然后从您的“取消”按钮调用此新SP。

For killing running SP refer this: 要杀死正在运行的SP,请参考以下内容:

How to terminate Oracle procedures which is running 如何终止正在运行的Oracle程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM