Problem with JDBC and DBMS_PIPE

From: <nwhitehe_at_yahoo.com>
Date: Thu, 07 Jan 1999 20:57:54 GMT
Message-ID: <77374g$g5n$1_at_nnrp1.dejanews.com>



Driver Version: Oracle 8 Thin
Database: 8.0.4 NT and 7.3.4 NT

In a seperate thread, I am running a "listener" through a connection by executing
DBMS_PIPE.RECEIVE_MESSAGE as follows:
while (cont) {
[CallableStatement]cs = sqlConn.prepareCall("BEGIN ?:= DBMS_PIPE.RECEIVE_MESSAGE(?); END;"); cs.registerOutParameter(1,
java.sql.Types.INTEGER, 0);
cs.setString(2, pipeName);
termOut("Listening on Pipe " + pipeName + "....");
cs.execute();
int exitCode = cs.getInt(1);

The code is in an infinite loop so it keeps listening for messages and it works fine, except when I try to stop the statement as follows: cont = false;
cs.cancel();
cs.close();

The cancel() statement executes immediately, but it does not really work because:

  1. The close() statement freezes and never executes.
  2. The connection object is not available for queries after a cancel() only (without the close())

How do I cancel the callable statement ?

Thanks !

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Jan 07 1999 - 21:57:54 CET

Original text of this message