I'm currently writing an app where some of the SQL statements can take a
while to process due to the shear size of the database.  What I'm trying to
do is move the sql processing to a secondary thread that we will have
running in the background.  The problem with running the SQL statements in
the main thread is that there is also comms stuff happining there that dies
when the query processes.

Everything I was doing before on the main thread is now being done in the
secondary thread, creating and establishing the database connection, running
the query etc...  But when executing the query on a large database the main
thread still pauses, not a hang, (leading to comms timeout problems).  It
will pause right after I go "MyQuery.ExecQuery;" and before the next line of
my code.  My suspicion is that there is still something that I may have
missed that does some processing on the main loop, possibly something
interface wise?  But this does not seem right as I have stepped through the
TFIBQuery.ExecQuery code which makes a call the an interbase dll, after
which my app pauses.  Checking the task manager under NT4 tells me that
there is only 20% CPU usage.  Checking ibserver.exe revels that interbase is
by no means busting it's gut proccesing my query, just under 20% CPU usage.
The app then continues to run fine after the query has finished processing,
except for the comms issue.

(The FIB code has no reference to TSession, not that it should anyway - I
checked anyway just in case.)

Does anyone have any ideas that could shead light on my problem?  Even
better, has someone done this already?  Any help would be welcome.


This is the setup that I'm currently using :

NT 4
Interbase 5.5 (default settings from install)
Latest version of Free IB Components (FIB)
Delphi 3 with all the patches.


Thanks in advance for any help.


Nahum Wild
CSG Software Developer
Swichtec Power Systems, Chch, NZ
---------------------------------------------------------------------------
  New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to