Subject Re: Can anyone help: Error reading data from the connection
Author nitaligavino
Hi Paul:

I have the same question as Martijn? Why can't threads share a db
handle / connection? As long as they are not concurrently sharing
the connection why can't this work?

Prior to this problem, I started a connection each time a thread was
created however this approach was too expensive, in terms of time.
Each call into isc_attach_database() is around 1.5 seconds. Can I do
anything about this?

Regards
Dan

--- In ib-support@y..., "Martijn Tonies" <m.tonies@u...> wrote:
> Paul,
>
>
> > nitaligavino 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?
>
>
> With regards,
>
> Martijn Tonies
> InterBase Workbench - the developer tool for InterBase
> http://www.upscene.com
>
> Firebird Workbench - the developer tool for Firebird
> http://www.upscene.com
>
> Upscene Productions
> http://www.upscene.com
>
> "This is an object-oriented system.
> If we change anything, the users object."