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

Home -> Community -> Usenet -> c.d.o.server -> Cancel() In JDBC CallableStatement

Cancel() In JDBC CallableStatement

From: <nwhitehe_at_yahoo.com>
Date: Tue, 05 Jan 1999 19:19:55 GMT
Message-ID: <76tokp$kfh$1@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 Tue Jan 05 1999 - 13:19:55 CST

Original text of this message

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