Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 24052 invoked from network); 22 Sep 2006 09:35:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Sep 2006 09:35:46 -0000 Received: (qmail 40304 invoked by uid 500); 22 Sep 2006 09:35:45 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 40295 invoked by uid 500); 22 Sep 2006 09:35:44 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 40284 invoked by uid 99); 22 Sep 2006 09:35:44 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Sep 2006 02:35:44 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=bofh@redwerk.com; spf=permerror X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received-SPF: error (idunn.apache.osuosl.org: domain redwerk.com from 85.90.206.104 cause and error) Received: from [85.90.206.104] ([85.90.206.104:54302] helo=office.redwerk.com) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 28/A3-06791-D6EA3154 for ; Fri, 22 Sep 2006 02:35:43 -0700 Received: from bofh by office.redwerk.com with local (Exim 4.63 (FreeBSD)) (envelope-from ) id 1GQhRh-000Aej-Gp for user-java@ibatis.apache.org; Fri, 22 Sep 2006 12:35:45 +0300 Date: Fri, 22 Sep 2006 12:35:45 +0300 From: Eugeny N Dzhurinsky To: user-java@ibatis.apache.org Subject: Re: passing connection to ibatis Message-ID: <20060922093545.GD40646@office.redwerk.com> Mail-Followup-To: user-java@ibatis.apache.org References: <20060921070823.GC982@office.redwerk.com> <446CAC4FA9FEF14FB0F3E7A507769EB008F8EE1E@USCOBRMFA-SE-70.northamerica.cexp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <446CAC4FA9FEF14FB0F3E7A507769EB008F8EE1E@USCOBRMFA-SE-70.northamerica.cexp.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Thu, Sep 21, 2006 at 10:31:02AM -0600, Patrick.Higgins@cexp.com wrote: > 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. That might work in case if I need to create those tables/views for each request for database, which isn't my case. I need to create such views only in certain cases and don't create them in other cases. If it would be possible to pass a connection to iBATIS somehow - that would definitely solve my problem -- Eugene N Dzhurinsky