cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <giac...@apache.org>
Subject Re: [C2] esql problem: pooling fails
Date Sun, 11 Feb 2001 20:44:42 GMT
Stefan L├╝ttringhaus-Kappel wrote:
> Hi,
>
> I'm using C2 checked out on 2001-02-09 (same problem occurs with
> a version from January), MySQL, mm.mysql-2.0.4, Linux and the very
> simple document:
>
> ----------------------------------------------
> <xsp:page language="java"
>   xmlns:xsp="http://apache.org/xsp"
>   xmlns:esql="http://apache.org/cocoon/SQL/v2"
>
>
>   <page>
>
>         <esql:connection>
>           <esql:pool>personnel</esql:pool>
>            <esql:execute-query>
>             <esql:query>
>               select * from TestVideos
>             </esql:query>
>             <esql:results>
>               <esql:row-results>
>                 <result>
>                   <esql:get-columns/>
>                 </result>
>               </esql:row-results>
>             </esql:results>
>           </esql:execute-query>
>         </esql:connection>
>
>   </page>
> </xsp:page>
> ----------------------------------------------
>
> In cocoon.xconf (sensitive info replaced by ...):
>
> ----------------------------------------------
>   <datasources>
>     <component-instance name="personnel"
> class="org.apache.avalon.util.datasource.JdbcDataSource">
>       <pool-controller min="5" max="10"/>
>       <dburl>jdbc:mysql://.../experiment</dburl>
>       <user>...</user>
>       <password>...</password>
>     </component-instance>
>   </datasources>
> ----------------------------------------------
>
> Each of the 10 connections is used only once, so I get
> "java.sql.SQLException: There are no more Connections available" after
> 10 queries which work as expected. I'm not yet a Cocoon expert, but I
> guess that connections should be given back to the pool and not just
> closed. In the generated program _esql_test_xsp.java, however, I read:
>
> ----------------------------------------------
> ....
>     finally { try {
>               if (!_esql_connection.connection.getAutoCommit()) {
>                   _esql_connection.connection.commit();
>                 }
>
>               _esql_connection.connection.close();  // !!!!!
>
>               if (_esql_connections.empty()) {
>                   _esql_connection = null;
>               } else {
>                   _esql_connection =
> (EsqlConnection)_esql_connections.pop();
>                 }
>             } catch (Exception _esql_exception_NF) {}
>             }
> ....
> ----------------------------------------------
>
> Is this ok? Is my setup / my concept wrong? I already searched the
> mailing lists and found nothing similar.

The connection you mentioned above is a wrapper around the real jdbc 
connection. The close methods only trigges the release to the pool (it is not 
really closed). We had a C2 app running for five days continously without any 
problems against a prostgres database. Could it be that mysql has a problem?

Giacomo
>
> Best regards,
> Stefan L├╝ttringhaus-Kappel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org

Mime
View raw message