Subject | Re: fbclient and thread-safety |
---|---|
Author | David Rushby |
Post date | 2006-09-13T15:22:05Z |
--- In firebird-support@yahoogroups.com, "precari0" <douglas@...> wrote:
certain Firebird version/operating system/protocol combinations. Some
fbclient configurations allow a single connection to be used serially
by multiple threads (that's what most people mean when they say
"thread-safe per-connection"), while other configurations require more
restrictive serialization.
There's a general overview of fbclient thread-safety here:
http://kinterbasdb.sourceforge.net/dist_docs/firebird-client-library-thread-safety-overview.html
I don't use Delphi, so I can't comment on whether there are any
threading issues specific to the Delphi components you're using.
> - Thread T1 creates connection C1 and uses it for some select/update.What you're doing appears to be sound, but it will only work with
> - C1 returns to the pool, waiting for new requests.
> - Thread T2 uses C1 for some operations.
> - C1 is in use by T2, a new request arrives.
> - Now T3 creates C2 and uses it for some operations.
> - C1 returns to the pool.
> - C2 returns to the pool.
>
> Is this sequence correct from a thread-safe perspective? Should it
> work?
> If this kind of sequence goes on for a while, the "invalid request
> handle" appears. But if I change my app so that every thread gets
> its own unique connection, the problem doesn´t happen.
certain Firebird version/operating system/protocol combinations. Some
fbclient configurations allow a single connection to be used serially
by multiple threads (that's what most people mean when they say
"thread-safe per-connection"), while other configurations require more
restrictive serialization.
There's a general overview of fbclient thread-safety here:
http://kinterbasdb.sourceforge.net/dist_docs/firebird-client-library-thread-safety-overview.html
I don't use Delphi, so I can't comment on whether there are any
threading issues specific to the Delphi components you're using.