I have some questions for threading with tmsquery:
1. is it safe to bind a tmsquery, which has been executed (.open) in other thread to a datasource and dbgrid? are there some precautions?
2. in which thread are the events like afteropen, beforeopen, afterscroll, oncalcfields etc. executed? in the execution thread or in the main thread?
3. or any other problems? I just have a form, a slow query, datasource and dbgrid, with lots of events set. What do I need to handle? I know about the new connection requirement, is there something more to do?
Thanks, Ludek.
threading?
threading?
Last edited by Ludek on Tue 26 May 2009 07:29, edited 1 time in total.
next questions:
how about cached updates? is it important, which tread calls applyupdates/commitupdates? or is there some rule to do it - i.e. always the thread, that executed the query, always the main thread...?
can i create the tmsquery object in one thread, the tmsconnection in other , open the tmsconnection in third and execute the query in forth thread? or are here some rules present?
thanks for answers!
how about cached updates? is it important, which tread calls applyupdates/commitupdates? or is there some rule to do it - i.e. always the thread, that executed the query, always the main thread...?
can i create the tmsquery object in one thread, the tmsconnection in other , open the tmsconnection in third and execute the query in forth thread? or are here some rules present?
thanks for answers!
If you execute a query in TMSQuery in separated thread then events (like AfterOpen, BeforeOpen) will be called in the execution thread.
To increase the perfomance on opening table you can set the FetchAll property and the NonBlocking option to False. If you use the NonBlocking mode you don't need to use a separated thread. You can find more detailed information about these properties in the SDAC help.
If the NonBlocking mode doesn't solve the problems or any other questions come up, please contact me.
To increase the perfomance on opening table you can set the FetchAll property and the NonBlocking option to False. If you use the NonBlocking mode you don't need to use a separated thread. You can find more detailed information about these properties in the SDAC help.
If the NonBlocking mode doesn't solve the problems or any other questions come up, please contact me.