I have a system which has to update several Tables up to 10 times a second.
For this I have several Forms:
The 'main' SQL form, which has MyConnection on it.
Then 3 other Forms, which each have up to 3 MyQuery's on them.
They now all run in the main thread. This is causing major delay's in the User interface.
I need to put all this 'background' SQL trafic in threads.
- Can this be done, and how?
- Can a MyQuery access a MyConnection which is in the Main Thread?
- Does anybody have some example code on how to achieve what I need?
Thanks,
Bart Kindt
Developer SARTrack Search and Rescue software.
www.sartrack.co.nz
Using MyQuery in Threads
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: Using MyQuery in Threads
Hello.
The right way to work in a multithreaded application is to have connection (the TMyConnection component) in each thread. You can have infinite amount of queries running through one connection in one thread, but you should not run several queries from several threads through one connection.
The right way to work in a multithreaded application is to have connection (the TMyConnection component) in each thread. You can have infinite amount of queries running through one connection in one thread, but you should not run several queries from several threads through one connection.