Subject | RE: [firebird-support] Firebird Embedded 2.1 Thread Safety |
---|---|
Author | Alan McDonald |
Post date | 2009-08-28T07:35:47Z |
> Hi Alan,I think that's effectively the same thing since once one of your threads has
>
> > I hope you meant "by multiple threads - ever" and not just at the
> same
> time.
>
> I don't, however since "Connection Pooling" is activated in the .NET
> wrapper
> that I use, it will leave the connection open when I "close" it and
> hand it
> to another thread that opens a "new" connection.
>
> Hope that makes no problems, since it speeds up things significantly.
>
> Stefan
a connection from the pool, no other thread will get it. The pool will grant
another thread another connection. i.e. they will never have the same
thread. Where it falls down is where people try to broker the use of their
multiple threads themselves across their own different connections. It's not
a simple thing to stop a thread from using a connection and ensure it stays
not in use until some other thread is finished. In your case the pool
manager is brokering the connection and won't give another thread the same
connection until the first thread is disconnected. The connection then only
stays live until it times-out or until another thread asks for one. I'll
stand corrected on this but that's how I think it works,
Alan