Jörg:

Increase the wait_timeout variable in the Mysql configuration file (my.cnf).

Viel Gluck,

Martin-

______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relating to the official business of Sender and is proprietary to Sender. It is confidential, legally privileged and protected by law. Sender does not own and endorse any other content.
(mobile) 617-852-7822
(http)www.laconiadatasystems.com




From: Jörg Linke <[EMAIL PROTECTED]>
Reply-To: <[EMAIL PROTECTED]>
To: <user@struts.apache.org>
Subject: MySQL error using connection pool
Date: Fri, 17 Jun 2005 22:25:23 +0200
MIME-Version: 1.0
Received: from mail.apache.org ([209.237.227.199]) by MC8-F15.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Fri, 17 Jun 2005 13:27:02 -0700
Received: (qmail 17890 invoked by uid 500); 17 Jun 2005 20:26:44 -0000
Received: (qmail 17868 invoked by uid 99); 17 Jun 2005 20:26:44 -0000
Received: pass (hermes.apache.org: local policy)
Received: from mail01.hansenet.de (HELO webmail.hansenet.de) (213.191.73.61) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Jun 2005 13:26:41 -0700 Received: from jl5 (213.39.160.196) by webmail.hansenet.de (7.2.059) id 42A52C39001830C0 for user@struts.apache.org; Fri, 17 Jun 2005 22:25:33 +0200
X-Message-Info: JGTYoYF78jE/UFvlSglz/PrBd9UtcqfZKHtvGB8F0hE=
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
List-Help: <mailto:[EMAIL PROTECTED]>
List-Post: <mailto:user@struts.apache.org>
List-Id: "Struts Users Mailing List" <user.struts.apache.org>
Delivered-To: mailing list user@struts.apache.org
X-ASF-Spam-Status: No, hits=0.0 required=10.0tests=
X-Spam-Check-By: apache.org
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 17 Jun 2005 20:27:02.0805 (UTC) FILETIME=[EBBB4450:01C5737A]

Hi,

I'm using Struts 1.0 and have defined two data sources in the
struts-config.xml:
  <data-sources>
    <data-source key="BuhhKursDB">
      <set-property property="autoCommit" value="false" />
      <set-property property="description" value="MySQL Data Source
Configuration" />
      <set-property property="driverClass" value="org.gjt.mm.mysql.Driver"
/>
      <set-property property="maxCount" value="4" />
      <set-property property="minCount" value="2" />
<set-property property="url" value="jdbc:mysql://localhost/buhhkurse"
/>
      <set-property property="user" value="buhhwebapp" />
      <set-property property="password" value="AmEsadS" />
      <set-property property="defaultReadOnly" value="true" />
      <set-property property="validationQuery" value="SELECT COUNT(*) FROM
seminar" />
      <set-property property="maxActive" value="1" />
    </data-source>
    <data-source key="BuhhStatsDB">
      <set-property property="autoCommit" value="true" />
      <set-property property="description" value="MySQL DB mit den
Statistiken" />
      <set-property property="driverClass" value="org.gjt.mm.mysql.Driver"
/>
      <set-property property="maxCount" value="4" />
      <set-property property="minCount" value="2" />
<set-property property="url" value="jdbc:mysql://localhost/buhhstats"
/>
      <set-property property="user" value="buhhwebapp" />
      <set-property property="password" value="AmEsadS" />
      <set-property property="defaultReadOnly" value="true" />
      <set-property property="validationQuery" value="SELECT COUNT(*) FROM
zugriffe" />
    </data-source>
  </data-sources>

I'm using these data sources in my action servlet in the following way:

try {
         dataSourceA = (DataSource)servlet.findDataSource("BuhhKursDB");
         dataSourceB = (DataSource)servlet.findDataSource("BuhhStatsDB");

         kursDbConn = dataSourceA.getConnection();
         statsDbConn = dataSourceB.getConnection();
         fillDatumDatenbestand(kursForm, kursDbConn);
           ....
}

  public void fillDatumDatenbestand(KurssucheForm kursForm, Connection
dbConn) {
    String sqlQuery = null;
    ResultSet rs = null;
    Statement stmt;
    sqlQuery =  "SELECT Max(Updatedatum) FROM updates";
    try{
      stmt = dbConn.createStatement();
      rs = stmt.executeQuery(sqlQuery);
      java.sql.Date updateDatum = null;

      if (rs != null) {
        while (rs.next()) {
          updateDatum = rs.getDate(1);
        }
        String datum = updateDatum.toString();
        kursForm.setDatenbestandJahr(datum.substring(0, 4));
        kursForm.setDatenbestandMonat(datum.substring(5, 7));
      }
    }catch(Exception e){
      e.printStackTrace();
    }
  }

Everything is working fine, until the web application idles for a longer
time.
Then the following error occures:

Connection was closed due to the following exception:

** BEGIN NESTED EXCEPTION **

java.sql.SQLException
MESSAGE: Communication link failure: java.io.EOFException, underlying cause:
null

** BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

java.io.EOFException
        at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1394)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1538)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1929)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1167)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1278)
        at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1224)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2248)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2196)
        at com.mysql.jdbc.Statement.executeQuery(Statement.java:1163)
        at
de.jlsolutions.webapps.buhh.PrepareKurssucheAction.fillDatumDatenbestand(Pre
pareKurssucheAction.java:118)
        at
de.jlsolutions.webapps.buhh.PrepareKurssucheAction.perform(PrepareKurssucheA
ction.java:56)

Has anybody an idea what is wrong?

Thanks,
Joe


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to