문제

I read the documentation for oci_cancel but it seems to me a bit fuzzy.

Does oci_cancel kill the sql process in the server?

If not, how can I make a script that executes a sql query, waits a moment and if the query exceeds 10 seconds (for example), cancel the query in the server?

Excuse me if this question is similar to one that has been asked time ago, but I didn't find any satisfactory answer.

도움이 되었습니까?

해결책 2

Eventually I had to use a solution that does not know if it's the best, but it was a mixture of things:

I was already using something like this to save the results of the querys in CSV files and then lift them into a session variable.

Well, I'm using this way to make a CSV file with the result of the query, sending the query by a PHP exec in background with a script in php with set_time_limit(10) and then waiting a time (10 seconds) until the result of the query has saved in a session variable. If the time(10 seconds) pass and I haven't got the query saved in the session variable I continue make the next actions.

다른 팁

PDO allows you to specify the query timeout with the "ATTR_TIMEOUT" attribute, although it's entirely dependent whether the driver supports it or not.

use set_time_limit if you want to cancel script execition and read this about oracle query cancelling

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top