cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berin Loritsch" <blorit...@apache.org>
Subject Re: [C2] esql problem: pooling fails
Date Sun, 11 Feb 2001 23:19:56 GMT
The connections are given back to the pool behind the scenes.  The design
constraint of the
Avalon DataSources is that they behave like the JDBC javax.sql.DataSource
Interface.

Check the WEB-INF/logs/cocoon.log function--if you are using DEBUG level
logging,
you should see that the Connection is requested from Cocoon, and then
returned to
Cocoon.  If there is something else happening, then please let me know.

----- Original Message -----
From: Stefan L├╝ttringhaus-Kappel <stefan@informatik.uni-bonn.de>
To: <cocoon-dev@xml.apache.org>
Sent: Sunday, February 11, 2001 2:54 PM
Subject: [C2] esql problem: pooling fails


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


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message