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 12:33:23 GMT
All connectins and transactions are managed using thread local
storage, so each thread has it's own connection, etc..


On 2/7/07, Abdullah Kauchali <abdullah.kauchali@isanusi.com> wrote:
> As I understand it, SqlMapClientImpl (SqlMapClient) hides or wraps the primary JDBC object,
Connection.  So, we can essentially do everything with SqlMapClient that we can with JDBC's
Connection object (including starting, commiting or aborting transactions).  However, with
iBatis, we don't have to explicitly manage the life times of the Connection objects as we
have to with JDBC's Connection object.  That's groovy.  :)
> Now, we also know that SqlMapClient can (and should) be configured as a (JVM) global
variable either by using it as a simple static variable or through the singleton pattern.
 Given that each thread that accesses the global SqlMapClient variable gets a copy of it (for
local work), how does iBatis know which connection object to retrieve from the pool - especially
if the SqlMapClient [sic] is participating in a transaction and the correct connection object
needs to be retrieved to chain the "transactionable" activities?
> Kind regards,
> A

View raw message