|
FOROS PROFESIONALES WINDEV, WEBDEV y WINDEV Mobile |
| | | | | |
| [WD21] - Question concerning connections & queries |
| Iniciado por Andrew, 23,ago. 2016 15:49 - 3 respuestas |
| |
| | | |
|
| |
Miembro registrado 31 mensajes |
|
| Publicado el 23,agosto 2016 - 15:49 |
I got myself a heavy duty query that takes about 10-20 seconds to execute. So of course I moved the query into a separate, background thread and just had it populate a collection of data structures and I set my thread-mode to Multi-Processor and Critical-Section.
This is wonderful -- the query executes in the separate thread and my GUI is still responsive and whatnot.
HOWEVER -- if I were to execute a query on the main thread (a small, itty-bitty query) while the background-thread's query is executing, the main thread hangs up. It needs to wait for the background-thread's query to finished executing before it can execute the main thread's query.
So, I thought that was a bit odd and that maybe it was a problem on the server/database side not being able to handle 2 connections belonging to the same process. So I forced the background-thread to connect to a different server. But that did not change anything at all.
So now my question --- is there a mutex on the function HExecuteSQLQuery in the WinDev framework? - or what else would be preventing me from having 2 queries execute at the same time on completely different servers and databases? |
| |
| |
| | | |
|
| | |
| |
| Publicado el 23,agosto 2016 - 18:38 |
Hi Andrew,
is your secondary thread using a separate HF contect or not?
Best regards
-- Fabrice Harari International WinDev, WebDev and WinDev mobile Consulting
Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM (open source)
More information on http://www.fabriceharari.com
Le 8/23/2016 à 7:49 AM, Andrew ANDREW MACKENZIE a écrit :
I got myself a heavy duty query that takes about 10-20 seconds to execute. So of course I moved the query into a separate, background thread and just had it populate a collection of data structures and I set my thread-mode to Multi-Processor and Critical-Section.
This is wonderful -- the query executes in the separate thread and my GUI is still responsive and whatnot.
HOWEVER -- if I were to execute a query on the main thread (a small, itty-bitty query) while the background-thread's query is executing, the main thread hangs up. It needs to wait for the background-thread's query to finished executing before it can execute the main thread's query. So, I thought that was a bit odd and that maybe it was a problem on the server/database side not being able to handle 2 connections belonging to the same process. So I forced the background-thread to connect to a different server. But that did not change anything at all.
So now my question --- is there a mutex on the function HExecuteSQLQuery in the WinDev framework? - or what else would be preventing me from having 2 queries execute at the same time on completely different servers and databases? |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 31 mensajes |
|
| Publicado el 24,agosto 2016 - 13:20 |
| Yup - I'm using threadFullCopyHFSQLContext in my ThreadExecute() call. |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 14 mensajes |
|
| Publicado el 24,julio 2018 - 11:50 |
Did you ever find a solution for this problem?
I have similar issue with NativeMYSql connection.
Best regards! |
| |
| |
| | | |
|
| | | | |
| | |
| | |
| |
|
|
|