how to stop a long query

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
janog

how to stop a long query

Post by janog » Thu 10 Feb 2005 11:45

Is there any possibility to stop long query (ex. after 30 sec.) on MS SQL?
Directly using DBExpress?
Externally using periodically activated stored proc?
Other solution?

Typical application:
- user connect
- user search data (different queries)
- user run complicated query and wait ... after 30 sec. query expires
(program can continue, query also stops physically on MS SQL)

Thanx
janog

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 10 Feb 2005 16:19

dbExpress doesn't provide an interface for this functionality. Probably, you should look for solutions used MS SQL ability or start using SDAC.

Guest

Post by Guest » Thu 10 Feb 2005 16:29

Ikar wrote:dbExpress doesn't provide an interface for this functionality. Probably, you should look for solutions used MS SQL ability or start using SDAC.
and SDAC has interface to setup local timeout for some query?
and how exactly... can stop query physically on SQL server.. or only doen't wait for query end and SQL server continues to process query?!

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 11 Feb 2005 10:25

You can set time in SDAC using CommandTimeout property. Or break at any moment execution at the server using BreakExec method. At the last case you have to create an additional thread.

janog

migration to SDAC

Post by janog » Fri 11 Feb 2005 14:42

ok.. is there any list of important notices and advices when migrating from dbExpress driver "dbexpsda" to SDAC ?
differences?
limitations?
known problems?
link to some papers? help files?

thanx

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 14 Feb 2005 14:02

dbExpress technology serves for most possible unification of accessing different servers (MS SQL, MySQL, Oracle and so on). It is Based on drivers including all specific of working with the certain server. As any universal tool, at the most specific cases dbExpress loses to specialized methods. For example, dbExpress design-time is quite poor and couldn't be expanded.

SDAC is a specialized set of components to access MS SQL Server with advanced design-time, with interface similar to BDE-components.

We tried to implement maximum support of MS SQL in SDAC and DbxSda, but at the last one, dbExpress technology puts restrictions.For example, Unicode fields cannot be passed from the driver to dbExpress.

SDAC and DbxSda use the same kernel, as a result they have similar performance. As for access OLE DB - the lowest level from documented protocol to work with MS SQL is used, the speed is quite high.

Verdict: if a possibility to re-build your application fast from using MS SQL to another server is important for you, you'd better use DbxSda. At the rest cases, especially on migration from BDE or ADO, you should use SDAC.

Guest

Post by Guest » Mon 14 Feb 2005 16:39

Ikar wrote:Verdict: if a possibility to re-build your application fast from using MS SQL to another server is important for you, you'd better use DbxSda. At the rest cases, especially on migration from BDE or ADO, you should use SDAC.
Important for me is to run my application against MS SQL and ORACLE... now i'm using dbExpSDA but limitations of dbExpress .. unicode fields and long queries (no support for Command Timeout) brings me to the idea of using SDAC...

So... can I use ODAC and SDAC in one application? Is there any possibility to use compiler directives?
I mean... some units special for SDAC an ODAC.
Rest of program can use some Parent Class ... Are sources of ODAC and SDAC based on similar structure of classes or not...?
It is importat to me to decide to buy SDAC and later ODAC....

Thanx

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Tue 15 Feb 2005 09:30

You can use SDAC and ODAC simultaneously. The only restriction is that builds of both products must be compatible, released at the same day.

> Are sources of ODAC and SDAC based on similar structure of classes or not...?

Yes, these products use common classes and too close between themselves. The difference is only at server-specific features.

Post Reply