cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan L├╝ttringhaus-Kappel <ste...@informatik.uni-bonn.de>
Subject [C2] esql problem: pooling fails
Date Sun, 11 Feb 2001 19:54:53 GMT
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.

Best regards,
Stefan L├╝ttringhaus-Kappel


Mime
View raw message