473,385 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

SQLCancel not working with UDB?

We have a setup with a v7 client accessing a v8 UDB server running on
AIX. When I call SQLCancel from a second thread on a long running query,
SQLCancel itself simply waits for statement completion too. That was not
the idea, no? Does anyone know how to fix this? Or is it not supported
(despite being described in the DB2 help)?

Regards
Peter Arrenbrecht
Opus Software AG
Nov 12 '05 #1
11 2221
Peter Arrenbrecht wrote:
We have a setup with a v7 client accessing a v8 UDB server running on
AIX. When I call SQLCancel from a second thread on a long running query,
SQLCancel itself simply waits for statement completion too. That was not
the idea, no? Does anyone know how to fix this? Or is it not supported
(despite being described in the DB2 help)?


What's your long-running query doing on the server?

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #2
It's doing something like

SELECT COUNT(*)
FROM HugeTable A, HugeTable B

which is, obviously, designed to be running for quite a while so I can
test SQLCancel. It does not work with something like

SELECT *
FROM BigTable
WHERE SomeField LIKE '%m%'

either, though. During the fetch phase it works OK, but that is not
where I need it. It should abort the execution of the initial
SQLExec/SQLPutData.
Knut Stolze wrote:
Peter Arrenbrecht wrote:

We have a setup with a v7 client accessing a v8 UDB server running on
AIX. When I call SQLCancel from a second thread on a long running query,
SQLCancel itself simply waits for statement completion too. That was not
the idea, no? Does anyone know how to fix this? Or is it not supported
(despite being described in the DB2 help)?

What's your long-running query doing on the server?

Nov 12 '05 #3
Peter Arrenbrecht wrote:
It's doing something like

SELECT COUNT(*)
FROM HugeTable A, HugeTable B

which is, obviously, designed to be running for quite a while so I can
test SQLCancel. It does not work with something like

SELECT *
FROM BigTable
WHERE SomeField LIKE '%m%'

either, though. During the fetch phase it works OK, but that is not
where I need it. It should abort the execution of the initial
SQLExec/SQLPutData.


The way I read the CLI Reference is that SQLCancel does not guarantee that
the statement execution is indeed terminated because it says: "How the
function is canceled depends upon the operating system." and later on "If
the original function is canceled, ..."

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #4
Knut Stolze <st****@de.ibm.com> writes:

The way I read the CLI Reference is that SQLCancel does not guarantee that
the statement execution is indeed terminated because it says: "How the
function is canceled depends upon the operating system." and later on "If
the original function is canceled, ..."


Damn, I hate APIs where the name lies :-)

The Truth in Advertising act says that we should have called it
SQLAttemptCancel :-)

--
#include <disclaimer.std> /* I don't speak for IBM ... */
/* Heck, I don't even speak for myself */
/* Don't believe me ? Ask my wife :-) */
Richard D. Latham la*****@us.ibm.com
Nov 12 '05 #5
Well, that was Microsoft who named this one, I believe. Nevertheless, at
least your docs could make a little more specific claims as to where
it's supported and where not.
Richard D. Latham wrote:
Knut Stolze <st****@de.ibm.com> writes:

The way I read the CLI Reference is that SQLCancel does not guarantee that
the statement execution is indeed terminated because it says: "How the
function is canceled depends upon the operating system." and later on "If
the original function is canceled, ..."

Damn, I hate APIs where the name lies :-)

The Truth in Advertising act says that we should have called it
SQLAttemptCancel :-)

Nov 12 '05 #6
Peter,

When you run the same query from CLP, can you CTRL-C it?
I have never had a case where I couldn't CTRL-C, but it is thinkable and
would need to be looked at.

Cheers
Serge
Nov 12 '05 #7
Peter Arrenbrecht <ar*********@NOXXX.opus.ch> wrote in message news:<41********@news.cybercity.ch>...
We have a setup with a v7 client accessing a v8 UDB server running on
AIX. When I call SQLCancel from a second thread on a long running query,
SQLCancel itself simply waits for statement completion too. That was not
the idea, no? Does anyone know how to fix this? Or is it not supported
(despite being described in the DB2 help)?

Regards
Peter Arrenbrecht
Opus Software AG


my preferred editor, Advanced Query Tool, stopped supporting asynchronous
queries in V8. they said it was because V8 stopped supporting it. so,
empirically, it worked. now it doesn't.

now, AQT is an ODBC based product; so shouldn't necessarily behave the
same on *nix. but if it is the same codebase.....

BobTheDataBaseBoy
Nov 12 '05 #8
In reply to Robert's post, and speaking as the developer of AQT. In
DB2 v7 we used the "asynchronous queries" capability of the DB2 ODBC
Driver; we ran queries asynchronously and issued the SQLCancel in the
same thread. This async capability appears to be removed in the DB2 v8
ODBC Driver. To circumvent this, we are using multi-threading; the
queries run in one thread, a second thread runs the cancel if the user
selects this. The second thread does an SQLCancel; this seems to work
fine for cancelling the query (we have done much testing of this). The
SQLCancel returns immediately (I have *never* find it to hang), though
as Knut says, it can take a while for the query to actually terminate.

Phil Castle.
gn*****@rcn.com (robert) wrote in message news:<da**************************@posting.google. com>...
Peter Arrenbrecht <ar*********@NOXXX.opus.ch> wrote in message news:<41********@news.cybercity.ch>...
We have a setup with a v7 client accessing a v8 UDB server running on
AIX. When I call SQLCancel from a second thread on a long running query,
SQLCancel itself simply waits for statement completion too. That was not
the idea, no? Does anyone know how to fix this? Or is it not supported
(despite being described in the DB2 help)?

Regards
Peter Arrenbrecht
Opus Software AG


my preferred editor, Advanced Query Tool, stopped supporting asynchronous
queries in V8. they said it was because V8 stopped supporting it. so,
empirically, it worked. now it doesn't.

now, AQT is an ODBC based product; so shouldn't necessarily behave the
same on *nix. but if it is the same codebase.....

BobTheDataBaseBoy

Nov 12 '05 #9
Serge

No, I cannot. Same behavior: it waits for completion of the statement,
but then aborts the fetching of results:

db2 => select count(*) from bookop where bookop_text like '%m%'

1
-----------

0 record(s) selected.

I tested this repeatedly. Normal execution takes about 7 secs. Hitting
Ctrl+C right after starting it takes 7 secs as well.

The setup is as follows:

DB2 v7 client on Windows 2K accessing a DB2 v8 server on AIX.

I shall try to test it with a v8 client as well.

Regards,
peo
Serge Rielau wrote:
Peter,

When you run the same query from CLP, can you CTRL-C it?
I have never had a case where I couldn't CTRL-C, but it is thinkable and
would need to be looked at.

Cheers
Serge

Nov 12 '05 #10
Serge and all others,

It works fine with a v8 client. I shall suggest to my client they
upgrade the client to v8 soon.

Thanks for caring,
peo
Serge Rielau wrote:
Peter,

When you run the same query from CLP, can you CTRL-C it?
I have never had a case where I couldn't CTRL-C, but it is thinkable and
would need to be looked at.

Cheers
Serge

Nov 12 '05 #11
robert wrote:
Peter Arrenbrecht <ar*********@NOXXX.opus.ch> wrote in message
news:<41********@news.cybercity.ch>...
We have a setup with a v7 client accessing a v8 UDB server running on
AIX. When I call SQLCancel from a second thread on a long running query,
SQLCancel itself simply waits for statement completion too. That was not
the idea, no? Does anyone know how to fix this? Or is it not supported
(despite being described in the DB2 help)?

Regards
Peter Arrenbrecht
Opus Software AG


my preferred editor, Advanced Query Tool, stopped supporting asynchronous
queries in V8. they said it was because V8 stopped supporting it. so,
empirically, it worked. now it doesn't.


SQLCancel and asynchronous execution are two completely different beasts.

SQLCancel: One thread executes a long running SQL statement, and it is
blocked waiting for the database server to return the control to the
calling thread. SQLCancel can now be used from another thread to flow the
interrupt information to the database server. The server will then take
the necessary actions to terminate the query at a convenient time.

Async: Asynchronous execution differs because you don't need two threads.
An async statement execution causes the control to return immediately to
the caller. Of course, the statement might not have finished, so the
caller has to check once in a while to test if the execution is done now.
You don't need multiple threads here.

Asynchronous execution is indeed not documented any longer (but it should
still work for backward-compatibility only, I believe) because you can do
the same thing using multiple threads.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gary | last post by:
I am trying to use the "System.Windows.Forms.SendKeys" class for triggering the Ctrl+P key. Syntax: System.Windows.Forms.SendKeys.Send("^(P)"); This is not working ..what could be the...
6
by: Mullin Yu | last post by:
hi, i have a web service that has file operations on Windows OS, and there may be a file concurrency issue if only one working directory e.g. c:\working therefore, i want to have a unique sub...
3
by: | last post by:
Hello, I am hoping someone else has thought about a date time calculation i need to perform. I would like to be able to calculate the number of "working minutes" between 2 dates, given my...
8
by: Hardy Wang | last post by:
Hi: Is it possible for me to create/open web application from remote machine other than port 80? And create application directly under virtual web site instead of creating a virtual directory?...
5
by: Martin Heuckeroth | last post by:
Hi We are working on a webservice application and are having some problems with the cookies and/or sessions. We have them working on our intranet but then its not working on the internet. We...
5
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
8
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs...
2
by: Don | last post by:
I'm having problems with intellisense, autocomplete, etc. suddenly not working in certain classes of a project I'm working on. All the options are set, and it all works fine for most classes, but...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.