Subject Re: [ib-support] Re: Can anyone help: Error reading data from the connection
Author Paul Reeves
Martijn Tonies wrote:
>>
>>>At this point another thread may
>>>acquire this db handle. Is this safe?
>>
>>
>>No. Start each thread and create the db handle within the thread.
>>
>>You need to think about keeping a pool of threads and letting each
>>thread signal when it is ready for new work.
>
>
> Why is this different? Or actually, why doesn't the other approach work?
>

In the first approach a pool of database handles are created in
(presumably) the main thread and a handle is passed to a worker thread
as required. This is the crux of the problem. The current library is
only thread safe if the database handle is created and used within the
same thread.


Paul
--

Paul Reeves
http://www.ibphoenix.com
Supporting users of Firebird and InterBase