You're only going to want to create temporary tables when the connection is created, not at the beginning of every transaction.
Depending on what kind of connection pool you're using, you may be able to use their connection lifecycle event handler to do this rather than rely on iBATIS to expose this functionality, which it probably can't do for most external pools, anyway (unless it wraps their mechanisms, but that assumes the API each connection pool exposes would be directly mappable onto the API that iBATIS would choose, which would probably not be true for many of them). If you're using DBCP, you might be able to your own implementation of org.apache.commons.dbcp.ConnectionFactory that creates the temporary tables before returning the connection from the createConnection() method. -----Original Message----- From: Eugeny N Dzhurinsky [mailto:[EMAIL PROTECTED] Sent: Thursday, September 21, 2006 1:08 AM To: [email protected] Subject: Re: passing connection to ibatis On Wed, Sep 20, 2006 at 09:59:12AM -0600, [EMAIL PROTECTED] wrote: > This sounds like it could be solved by a connection lifecycle event handler > that Clinton mentioned on Sept. 16th: > > http://www.mail-archive.com/[email protected]/msg06174.html > > Strangely, I've actually needed this functionality before. I created a bunch > of temporary tables with Postgres and the fact that they didn't persist from > connection to connection was a major pain, but somehow I worked a connection > lifecycle event handler into the framework I was using (I can't even > remember what it was, it's been so long ago now). So I guess we have at > least two use cases for that feature now. I'll see if I can free up some > time to write a patch. :-) Well, I found another possible thing - if I call SqlMapClient.startTransaction() method, then it is posible to obtain current connection with SqlMapClient.getCurrentConnection() and do various things, but I'm not sure will that connection be explicitly released after SqlMapClient.commitTransation()/endTransaction() or it there is a possibility to reuse that connection by some other module? -- Eugene N Dzhurinsky
