OpenEdge 11: ODBC/JDBC, 000074191: Cancelling a JDBC-initiat

Posted by Stefan Marquardt on 17-Nov-2016 07:13

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();

All Replies

Posted by Donicello Lampe on 18-Nov-2016 05:38

Hi Stefan,

It's not a misunderstanding from your side, but rather a mistake on our side. Our apologies for causing the confusion. When the KBase article was initially created we failed to check whether this was also supported by the SQL engine. The KBase article in question has now been updated with the correct information.

Regards,

Donicello Lampe

Posted by Stefan Marquardt on 18-Nov-2016 07:59

The blame was that I trusted the KB and asked the squirrel developer that something is wrong on his side.

Please tell me who wrote this KB because he and others (any customer) seems to think that it really works.

Please vote for it, or is nobody using JDBC for OpenEdge for live queries on production server?

(only reliable if not using the new width features)

community.progress.com/.../openedge_should_support_cancel_request_for_long_running_sql_queries_through_jdbcodbc

Posted by Donicello Lampe on 18-Nov-2016 08:46

Hi Stefan,

I voted already, hopefully more people will as well. It looks like this feature has not been requested a lot, because that KBase article was only used once before (now twice with your case). As you mentioned, still some people may believe that this should work, so we will take care of informing all parties involved regarding this KBase article to prevent any further confusion.

Regards,

Donicello Lampe

This thread is closed