cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: cvs commit: xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/java esql.xsl
Date Thu, 11 Jan 2001 15:04:38 GMT
balld@apache.org wrote:

> balld       01/01/10 20:57:13
> 
> 
> 
>   Modified:    src/org/apache/cocoon/components/language/markup/xsp/java
> 
>                         Tag: xml-cocoon2 esql.xsl
> 
>   Log:
> 
>   unified the c1 and c2 esql logicsheets


You seriously broke this is c2!  Cocoon 2 DOES NOT USE TURBINE!!!  We cannot
make that assumption.  I put in alot of work making a Connection Pooling
framework that works with both Avalon and javax.sql.DataSource patterns.
As is specified in the JDBC documentation, any pooling should be done without
altering the way a user normally uses the Connection object (i.e. when they
invoke the "close" method, it should reclaim the connection to the pool).

I will REimplement the way connections should be used in esql as soon as I get
a chance--unless you get to it first.

You can get the Connection object using this methodology:

import org.apache.cocoon.components.datasource.DataSourceComponent;

....

ComponentSelector selector = (ComponentSelector) this.manager.lookup(Roles.DB_CONNECTION);
DataSourceComponent datasource = (DataSourceComponent) selector.select(<xsl:value-of select="$use-connection">);
Connection conn = datasource.getConnection();

.... // do SQL stuff ......

conn.close();
Please correct this.


Mime
View raw message