cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: GroovyMarkup syntax works!
Date Thu, 15 Apr 2004 16:20:49 GMT
On 15 Apr 2004, at 17:16, Bertrand Delacretaz wrote:
> Le 15 avr. 04, à 18:01, a écrit :
>> ...BTW you could just create the Sql object with a DataSource which 
>> is-a JDBC connection pool, then the Sql object takes care of all the 
>> pooling for you. Is there support for DataSource in Cocoon or some 
>> 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 
> 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 
> the pool
>   public void releaseConnections()
> }
> In this way, the Groovy script can access any Connections that are 
> configured, and does not have to care about releasing them. It's easy 
> to implement in case we don't have DataSource support.

You might as well just use DataSource then as this is pretty close to 
all DataSource is. (Or at the least get ConnectionProvider to implement 

There's an implementation in Jakarta Commons dbcp and various JDBC 
drivers come with an implementation of DataSource for you already (e.g. 
Oracle & Axion).

If nothing else just provide a DataSource facade to whatever connection 
pool you use and the groovy.sql.Sql will work fine with your pool.


View raw message