Subject Re: [firebird-support] Delphi dbExpress and Threads
Author Martijn Tonies
Hello Christian,

> I tried in the Borland news groups and go no answer, maybe mentioning
> Firebird there is not really welcome. So I try here:
>
> I have an application, that uses dbExpress to connect to a Firebird
> database (with Upscene driver). The system is built to run with
> different threads. It works fine on the local, single processor
> machine, but there are problems on a multi processor machine.
>
> Finding what I did wrong is not easy, so I have some questions to
> start:
>
> I created a pool of DB objects (a connection and some queries), where
> a thread can aquire an object to get/manipulate data in the database.
>
> Should these objects (with the TSqlConnection's) always be created in
> the main thread?

If you pass an owner, then yes, I think you need to create them all in
the main thread.

> I think, a connection can be "Active", when left in the pool and later
> used by another thread.

Yes, they can.

>What about queries? Should queries always be
> recreated by a thread?

No.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com