Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Killing a blocked Java dequeue in Advanced Queuing (AQ)

Killing a blocked Java dequeue in Advanced Queuing (AQ)

From: Kenneth Tam <k2tam_at_ecexh.uwaterloo.ca>
Date: 2000/07/09
Message-ID: <8karpu$bv8$1@watserv3.uwaterloo.ca>#1/1

I'm developing an Advanced Queuing (AQ) application in Java. I'd like to know how to interrupt a blocked call to AQQueue.dequeue(). Basically, I have a thread that's constantly monitoring a queue via blocking dequeue, and I'd like to be able to shut it down cleanly. It seems braindead that there isn't a way to do this; I tried:

  1. closing the Connection object that's backing the queue -- which is actually impossible, since it looks like Connection.close() blocks waiting for the dequeue to finish!
  2. calling Thread.interrupt() on the blocked thread. This has no effect (not surprising, since AQQueue.dequeue isn't declared to to throw InterruptedException or InterruptedIOException -- which would seem to be a pretty useful thing to do).

I am reduced to the solution of "block for x seconds and then check if I've been killed", which is just lame.. someone please tell me there's a better way.

thanks! Received on Sun Jul 09 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US