[yunqa.de] Re: [?? Probable Spam] TDISQLite3Database - Event to show progress when executing a Transaction?

  • From: Tobias Rapp <t.rapp@xxxxxxxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Fri, 12 Dec 2014 15:09:43 +0100

What appeared to happen was that the timer was enabled and then the sql
ran OK.
But only after the sql had completely finished did the timer get to fire
its OnTimer event for the very first time.
It was as if DISQLite3Database1.Execute had prevented any other events
being picked up, so the timer didn't fire until the sql had finished.
The timer event is executed by the VCL message pump which will not run until the SQL command has been processed.

I see two options:
a) Break your lengthy SQL statement is several blocks (e.g. if you insert a long list of data rows). Update your progress indicator in between these blocks.

b) Move all SQLite database handling into an own thread. This requires communication mechanism between your main thread and the DB thread (Locks, PostMessage, etc.) and usually adds quite some complexity.

Regards,
Tobias

_______________________________________________
Delphi Inspiration mailing list
yunqa@xxxxxxxxxxxxx
//www.freelists.org/list/yunqa



Other related posts:

  • » [yunqa.de] Re: [?? Probable Spam] TDISQLite3Database - Event to show progress when executing a Transaction? - Tobias Rapp