Currently I have a user specified Eclipselink query running inside a Foxtrot "ConcurrentWorker" task, and I want to user to be able to abort it. The query naturally is either busy in the SQL (JDBC classes) or busy fetching data (Eclipselink).
The recommended approach is not possible, since I do not have a way to insert a stop-flag into either the JDBC or Eclipselink code. I try to fire a Thread.interrupt on the thread in question, but it does not abort the query.
Is it possible to abort a query (this is not a timeout)?
Setting the query timeout is probably your best options.
Some JDBC drivers support a cancel() API, but whether this is supported is
dependent on the JDBC driver and the database. There is no API in JPA or
EclipseLink to cancel a query, so you would need to obtain the JDBC
statement to attempt to cancel it. Feel free to log an enhancement
request to have a cancel() API added to EclipseLink.