IB6 query: aborting / registering for callback

Posted on 2003-10-31
Medium Priority
Last Modified: 2010-04-05

I checked the Interbase documentation, yet I have not found anything about aborting a query. Can it be aborted at all? Is there a way to register for a callback to provide some feedback to the user when executing a query?

Question by:Leslie7
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4

Expert Comment

ID: 9662920
1. I am not aware of any mechanism that allows a query to be aborted.  I work more with DB2 than Interbase, so my knowledge on this should not be taken as definitive.

2. There is a set of interbase monitoring components in Delphi 6 and up.  These should provide the functionality you are looking for, or their source code in the VCL source should allow you to develop the programming techniques for your callbacks.


Author Comment

ID: 9670808
Hi  swift99,

It is strange that even DB2 does not allow aborting a query. It seems so simple to add such functionality. :(

I need some time to check if interbase monitoring components can really help me.

Expert Comment

ID: 9671140
Adding that functionality could have significant performance implications, since an SQL engine will be, by necessity, a state engine returning stateless result sets.  I can see generally how it could be done, but making it reliable is not necessarily simple.  

I agree that it would be nice to have an abort sometimes.
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 9674044
I guessed it might not as easy as it "seems". :)  

If the possibility of abortion would only be an option, the programmer could decide what is more important in every case.

I suppose the actual performance decrease depends on how often (on which “levels”) the engine checks for abortion. This could also be an option to fine tune between speed and reaction time.  

In case many queries (especially time consuming ones) needs to be aborted, the system performance sometimes can even increase, since the engine does not have to spend time on finishing useless queries and delay useful ones.  (I have such situation.)

Do you know any SQL engine at all which allows query abortion?


Accepted Solution

swift99 earned 1000 total points
ID: 9674234
Well ...

You can get Firebird (the open source version of Interbase).  Since it is open source, you could look and see for yourself, and even submit any changes you made to the commuity for approval   :o)

If I needed abort functionality, I would look at two things:

1. improving access paths so that I don't need abort
2. refining the granularity of my SQL so it is several distinct but very fast queries, allowing my program to abort between queries.

In the second case I would use a sideways loop in a separate thread from the GUI thread, which allows the GUI thread to set a flag and continue reacting to the user, and the query thread to finish and terminate in its own time.

Author Comment

ID: 9681504
…taking part in Firebird development ,  well … I don’t think I’m qualified for that at the moment. It would take “some”  :)  time to learn the inside details of  Firebird too. Though it would be nice to use an SQL engine which source code is avaible. It can be debugged …

 I have optimized everything I could, query abortion is probably the only thing left. Queries cannot be taken apart any more. Actually my conclusion was the same as your 2nd suggestion.

Thanks for your help.

Expert Comment

ID: 9691862
What are your indexes like?

Author Comment

ID: 9697603
I always pay attention on building the proper indexes. There is no more speed to gain there. :)

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question