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

I was a bit perplexed after reading Fred's posting. He is doing
exactly what I was attempting to do? The funny thing is, I was able
to run a test harness, 20+ concurrent threads, re-using db handles
without any issues; okay a few deadlocks. Maybe I will look into
this as well, when time permits. For now I'm sticking to the tried
and true, create thread create connection. Also to answer your open
question, for me I'm connecting via a TCP/IP connection:
"localhost:c:/database/db.gdb" Local
connections: "c:/database/db.gdb" did not work. When trying to
connect multiple times for the same process using a local connect
will lock the engine and the process for that matter.

As a side note: I narrowed the problem down, I think, to the
following api calls:
isc_dsql_allocate_statement and or isc_dsql_prepare. Every time I
received the error it was executing one of these calls?

Dan Crea


--- In ib-support@y..., Paul Reeves <paul@f...> wrote:
> Wilson, Fred wrote:
> > Can anyone else confirm this, absolutely. This sounds a little
suspicious
> > the TSL and all.
>
> Well, I should come clean and say that based on personal
experience, I
> can't confirm or deny this. That said, I have been paying attention
over
> the last five or six years and yours is the first testimony I have
heard
> that has had success with re-use of database handles across threads.
>
> In general the story goes like this
>
> - Developer tries to re-use database handles.
> - Developer comes to grief
> - Developer posts problem to interbase list
> (as was) or ib-support (as is).
> - Those who have gone before pass on the wise advice that db handles
> are not re-entrant (ie, not thread safe.)
>
> So, as the messenger in all this, it seems to me that the only way
to
> work this is to create the thread and then create the database
handle in
> the thread.
>
> One day, when I have time, I want to take a look at this issue in
more
> detail, but for now it remains on my growing list of things I would
like
> to do, if I had the time.
>
> One question - are you connecting locally or via tcp? (or named
pipes?).
>
>
> Paul
>
>
> --
>
> Paul Reeves
> http://www.ibphoenix.com
> Supporting users of Firebird and InterBase