cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <>
Subject Re: [C2] DataSources Proposal
Date Fri, 05 Jan 2001 22:48:19 GMT
Berin Loritsch wrote:
> I am in the process of attempting to use Cocoon in a J2EE infrastructure.  This means
> the DataSources included in the J2EE Container.  There are two issues that I want to
> in preparing Cocoon 2 to work seemlessly in this environment.  The first is using one
> DataSource definition for _ALL_ the database connections in esql and the sql transformer.
> This makes the management of datasources much easier to the end user.  The second is
> JNDI to obtain the DataSource from the J2EE Container.
> I propose to solve the issue in this manner:
> Create a DataSourceComponent in Cocoon that inherits from Component, Poolable,
> Configurable, and DataSource.  Create a JdbcDataSource that calls the JDBC
> Driver using the normal connection parameters (dburl, driver, usernam, password).
> Create a J2eeDataSource that calls the JDBC Driver through JNDI.
> In both instances, the DataSource is a Component, so every XSP page or any other
> Composer will be able to have access to it.  (Imagine setting Actions to directly
> handle the database without having to worry about complex configurations).

+1024^1024 :))

> The J2eeDataSource will only be compiled when JNDI is present.

Easy to solve with ant :)

> Toward that end, I need to know if this is something that you guys would be interested
> in having in the Cocoon source.  

+1 again

> If that is the case, I need to know what package name
> to use.  I was thinking the following:
> org.apache.cocoon.components.datasource/
> DataSourceComponent
> JdbcDataSource
> J2eeDataSource
> They would be included in the cocoon.xconf file using a ComponentSelector because
> you can potentially have multiple database connections in Cocoon.
> Any thoughts or requests for clarification?

I think all you have explained and suggested make total sense. 

Having this as a Component in the cocoon.xconf file is exactly what I'd
like. I was thinking about how to implement a JDBC connection pool and
looked into C1. But the Turbine pool isn't what I'd like to have in C2
because it's not a Avalon Component and I think it doesn't fit into the
C2 architecture.


View raw message