ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abdullah Kauchali <abdullah.kauch...@isanusi.com>
Subject How does iBatis know which connection object to use from a pool?
Date Wed, 07 Feb 2007 09:24:52 GMT
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,


  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message