node.jsnode-oracledb

node.js + oracledb - Interrupt ongoing query


I'm, currently developing a web interface in node.js for directly executing SELECT queries from a log table in an Oracle Database. For that purpose I'm using oracledb.

Since our log table is quite big, the SELECT query might take a long time, even if the result set is just a few rows (< 10).

I want to allow users to interrupt the operation if it is taking too long. Using cursors or limiting the number of rows does not help since the query itself takes a long time to complete.

The only way it seems possible to interrupt a query previously started using this method is by closing the connection to the database using this method. Is there any other way to interrupt an ongoing query using oracledb?


Solution

  • I just found the solution. In order to stop an ongoing operation, one must call the break method on the connection, as described here.