Subject Re: What can cause "Transaction start failed. deadlock" in Firebird 2.0.3?
Author Adam
--- In firebird-support@yahoogroups.com, "Antti Nivala"
<antti.nivala@...> wrote:
>
> Hi Vlad,
>
> > Is this threads share the same connection or its have own connections
> ?
>
> We are not using the same connection from two threads simultaneously,
> but for performance reasons, we are caching (pooling) connections.
> Another thread may pick the connection at a later time and start a new
> transaction.
>
> Whenever a thread needs to do something with the database, it performs
> the following steps:
>
> 1. Gets an existing connection from the pool (and removes it from the
> pool).

Are you 100% sure that two threads can not possibly grab the same
connection at the same moment in time?
>
> 2. Starts a new transaction.
>
> 3. Executes the query.
>
> 4. Commits the transaction.
>
> 5. Puts the connection back to the pool.

Are you 100% sure that a thread can not possibly return a connection
back into the pool without commit or rollback (eg, you are trapping
exceptions when there is an issue in 3 or 4.

Adam