Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 83307 invoked from network); 15 Apr 2004 16:28:33 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 15 Apr 2004 16:28:33 -0000 Received: (qmail 96267 invoked by uid 500); 15 Apr 2004 16:28:21 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 96209 invoked by uid 500); 15 Apr 2004 16:28:21 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Delivered-To: moderator for dev@cocoon.apache.org Received: (qmail 73464 invoked from network); 15 Apr 2004 16:20:49 -0000 In-Reply-To: <397A40AC-8EF8-11D8-844A-000A95AF004E@apache.org> References: <2DEA31D6-8EF6-11D8-B513-000A959D0312@mac.com> <397A40AC-8EF8-11D8-844A-000A95AF004E@apache.org> Mime-Version: 1.0 (Apple Message framework v613) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable Cc: dev@cocoon.apache.org From: jastrachan@mac.com Subject: Re: GroovyMarkup syntax works! Date: Thu, 15 Apr 2004 17:20:49 +0100 To: Bertrand Delacretaz X-Mailer: Apple Mail (2.613) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On 15 Apr 2004, at 17:16, Bertrand Delacretaz wrote: > Le 15 avr. 04, =E0 18:01, jastrachan@mac.com a =E9crit : > >> ...BTW you could just create the Sql object with a DataSource which=20= >> is-a JDBC connection pool, then the Sql object takes care of all the=20= >> pooling for you. Is there support for DataSource in Cocoon or some=20 >> kinda adapter between DataSource and ConnectionProvider?... > > Dunno about javax.sql.DataSource support, I'll have to check. > > ConnectionProvider does not exist yet, I just made it up with the=20 > following idea: Ah OK :) > public class ConnectionProvider { > // Groovy scripts which need a Connection will use this to get > // it from the Cocoon pool > public Connection getConnection(String connectionName); > > // then, once the Groovy script has been executed, ScriptGenerator > // calls this to return all connections provided by getConnection to=20= > the pool > public void releaseConnections() > } > > In this way, the Groovy script can access any Connections that are=20 > configured, and does not have to care about releasing them. It's easy=20= > to implement in case we don't have DataSource support. You might as well just use DataSource then as this is pretty close to=20 all DataSource is. (Or at the least get ConnectionProvider to implement=20= DataSource) There's an implementation in Jakarta Commons dbcp and various JDBC=20 drivers come with an implementation of DataSource for you already (e.g.=20= Oracle & Axion). If nothing else just provide a DataSource facade to whatever connection=20= pool you use and the groovy.sql.Sql will work fine with your pool. James ------- http://radio.weblogs.com/0112098/