ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Meadors" <lmead...@apache.org>
Subject Re: How does iBatis know which connection object to use from a pool?
Date Wed, 07 Feb 2007 15:10:00 GMT
Almost, but not exactly. ;-)

The connection does not remain with the thread for the life of the
thread, but rather the thread gets the connection from the pool (the
pool marks it as used so no one else gets it), then uses it, then
closes it (which just tells the pool that it can give it to others).

I have not ever looked into if it checks for active transactions, I'd
guess that the assumption is that they are clean.


On 2/7/07, Abdullah Kauchali <abdullah.kauchali@isanusi.com> wrote:
> From:       Larry Meadors [lmeadors@apache.org]:
> >All connectins and transactions are managed using thread local
> >storage, so each thread has it's own connection, etc..
> (Thanks Larry!)
> Ok.  Understood.  So, each time a new thread that uses SqlMapClientImpl is spawned, a
Connection object is removed from the pool and remains with the thread local instance of SqlMapClientImpl
until the thread is finished (or just before it), at which point the Connection object is
returned to the pool?
> Is there any checking of active transactions on Connection objects before getting it
from and after putting it back into the pool?
> Kind regards,
> A

View raw message