S
Stefan Marquardt
Guest
A few weeks ago I got a PANS about this article. I except that somebody called PSC and asked them about this topic as I did months ago without a resolution. No I read this article and tried it again with Squirrel and it doesn't works (again) and I re-opened my case. Meanwhile I got a very honest reply from PSC: The problem here is that the cancel operation is supported with the JDBC OpenEdge driver but our OpenEdge SQL server does not support an ability for a client to cancel an executing statement Perhaps it's a big misunderstanding from my side? There is a KB article for OpenEdge 11.x with a well described example but it does not work?! It seems to be that the ODBC/JDBC development team has a communication issue. Canceling is very important to give the j(o)dbc users a availability to cancel misformed long running queries which increase performance. Article Number 000074191 Environment Product: OpenEdge Version: 11.x OS: All supported platforms Other: SQL Question/Problem Description Can a JDBC-initiated SQL query be cancelled or aborted. Steps to Reproduce Clarifying Information The client code is written in Java. The Connection object's abort() method is not supported. Assume an SQL query is initiated from Java. The Java code might look like the following: Assume a Connection object, connected to the database, exists. The instantiated Connection object is called myConnection. Assume the query is against the sports2000 database and the Customer table within the sports2000 database. Statement myStatement = null; String myQuery = "select * from PUB.Customer"; try { myStatement = myConnection.createStatement(). ResultSet myRs = myStatement.executeQuery(myQuery ); /* The remainder of the try block processes what is returned by the SQL query. */ } CATCH {SQLException e) { /* exception handling code */ } finally { if (myStatement != null) { myStatement.close();} } Error Message Defect/Enhancement Number Cause Resolution In a separate thread, call the Statement object's cancel() method. The Statement object created in the thread that initiated the query must be passed to the separate thread that cancels the query. Assume myStatement is the Statement object. The separate thread should have a timeout associated with it to ensure it exits should the attempt to cancel the SQL query fail. A call to the Statement object's cancel method looks like the following: if (myStatement != null && !myStatement.isClosed()) { myStatement.cancel();
Continue reading...
Continue reading...