Adding my thoughts... (and yes, I've read JCIP several times - a great
book).

In general, using JDBC sends a query to another process, usually
running on a separate server (such as Oracle, Postgresql). The only
sure way to stop a long-running query is using statement.cancel().

Thread.interrupt as a way to stop a query makes sense for an embedded
database like H2, but is not an approach you can rely on in general in
JDBC.

In my experience with Oracle, even if your Java client software
completely exits cleanly with all threads ended, an incomplete query
still continues running on Oracle until complete.

So in general, use statement.cancel() in JDBC. Unfortunately this
requires convoluted code, as the interrupting thread needs a handle to
the statement in the thread running the long-running query.





On Nov 18, 8:25 am, Thomas Mueller <[email protected]>
wrote:
> Hi,
>
> > _Java Concurrency in Practice_
>
> Thanks.
>
> H2 supports canceling statements using Statement.cancel(). I will add
> support for Thread.interrupt to the roadmap, but I'm not sure when I
> will have time to implement it.
>
> Regards,
> Thomas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to