Home > Archive > SQL Server JDBC > May 2005 > PreparedStatement.cancel() does not work with SP3









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PreparedStatement.cancel() does not work with SP3
Noam Ambar

2005-05-17, 3:23 am

Hello,

I have a client/server application that allows users to run queries on a
database. The server monitors the client and if the user cancel the query,it
uses PreparedStatement.cancel() to cancel the query in the database and save
CPU cycles.

It used to work with MS JDBC Drivers SP1 and it does not work since I
replaced the drivers to MS JDBC Drivers SP3.

Is there a fix/workaround for this? is there a way to cancel the statement
by running a sql command (I can't use KILL <spid> since there are no "Process
Admin" permissions on the database).

Thanks,

Noam
Noam Ambar

2005-05-17, 3:23 am

When using SP3, the cancel() call hangs until the long query ends and I see
that the query is still running in the database. With SP1, it canceled the
query immediately.
Sue Purkis

2005-05-17, 1:23 pm

Noam,
Can you please post the code that you are using? I would like to try and
recreate what you are seeing -- but I want to make sure I am clear on what
you are doing.

Thanks.
Sue Purkis
DataDirect Technologies.

"Noam Ambar" < NoamAmbar@discussion
s.microsoft.com> wrote in message
news:929EE084-FFE8-4762-89E7- 63467CB520AF@microso
ft.com...
> When using SP3, the cancel() call hangs until the long query ends and I

see
> that the query is still running in the database. With SP1, it canceled the
> query immediately.



Noam Ambar

2005-05-18, 3:23 am

I've tried to create a simple scenario of it, and it worked both in SP1 and
SP3. I've look for the differences in my code and found out that there was a
bug and the statement was executed twice.

It seems that there is a behavior difference between SP1 and SP3 in this
case. SP1 canceled both statements and SP3 canceled only the first statement
(which is OK).

Thanks for helping me to understand this.

Noam


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com