query progress/feedback

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

query progress/feedback

Post by sandy771 » Sun 01 Jul 2007 12:02

is there any way (other than implementing a query in a thread) or preventing my application hanging when running complex queries on large databases that take a few 10's of seconds to return?

Some method of calling application->ProcessMessages() to ensure that the app doesn't freeze would be enough

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 03 Jul 2007 08:15

Now MyDAC can not execute queries in the way you have described. We are considering a possibility to add such functionality in one of the next MyDAC build or version.

eimix
Posts: 5
Joined: Fri 12 Sep 2008 12:52

Post by eimix » Thu 29 Jan 2009 20:34

Hi,

are any updates on this issue?
i also need such functionality, and i do not like to mess with threads my self :roll:

Thanks, eimix

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 05 Feb 2009 09:05

To solve this problem you can use FetchAll = False mode.

eimix
Posts: 5
Joined: Fri 12 Sep 2008 12:52

Post by eimix » Thu 05 Feb 2009 09:10

Fetch all does nothing special - becouse my Query Execution takes eg. 12seconds, data fetching 0.5seconds (~10000 records)

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 09 Feb 2009 15:18

Now MyDAC does not provide such functionality.

eimix
Posts: 5
Joined: Fri 12 Sep 2008 12:52

Post by eimix » Mon 09 Feb 2009 21:14

Is it in future plans?

I tried to do it my self, it works in simple cases :)
but it is unpredictible - it crashes time to time - becouse of alot of stuff working same time :)

I used this approach:
i have everything created in main thread, and execution of queries running in other thread. During query execution main thread is displaying some progressbar or some animation. Also main thread processes messages (except ones in WM_MOUSEFIRST-WM_MOUSELAST and WM_KEYFIRST-WM_KEYLAST) - in such way - application can be resized, moved and so on :)

I put DisableControls and EnableControls to disable grids and other components that displays data.

But still some unexplainable exceptions rises :(

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Tue 10 Feb 2009 15:42

Hi eimix,

I've just discovered this great library today : OmniThreadLibrary

Quoted from their website :
What is OmniThreadLibrary?

OmniThreadLibrary is a simple to use threading library for Delphi. OTL's main "selling" points (besides the prices, of course ;) are power, simplicity, and openess. With just few lines of code, you can set up multiple threads, send messages between them, process Windows messages and more. OTL doesn't limit you in any way - if it is not powerfull enough for you, you can ignore any part of its "smartness" and replace it with your own code.
Faq : http://otl.17slon.com/faq.htm
Download : http://code.google.com/p/omnithreadlibr ... loads/list

I've created a simple project :
1 Form with :
- 1 Grid ,
- 1 Datasource,
- 1 MyQuery,
- 1 MyConnection,
- 1 Button.

When clicking on the button I'm executing an SQL Query that is fetching more than 700 000 records (table has about 30 fields). The query is executed inside a thread (very very easy thanks to omnithread). The only thing that I needed to do was a MyQuery.DisableControl / MyQuery.EnableControl.

Post Reply