1 Reply Latest reply on Jun 26, 2003 4:08 AM by ateppo

    mysql drops idle connections

    nicfournier

      Hi.

      I am currently using jboss 3.2 with mysql. My problem lies in the fact that mysql drops connections idle for 8 hours (which happens every night). I have tried putting autoReconnect=true in the mysql driver url but it does not work. In the documentation on mysql.com, it says that autoReconnect only works if autoCommit=true. Because jboss sets it to false, i'm screwed.

      Is there an other solution ?? Is it possible that jboss tests the validity of a connection before using it ???

      Thanks!

      Nicolas.

        • 1. Re: mysql drops idle connections
          ateppo

          I had a similar problem with JBoss 3.0.7. Upgrading to 3.0.8 resolved the problem. Are you using 3.2.2? Maybe upgrading to that version would help.
          Normally JBoss closes the idle connections in the pool after the IdleTimeout minutes defined in the datasource definition XML (sample definitions use 15min timeout), so you shouldn't need to worry about the 8 hours Mysql server timeout. However, there was some bug at least in 3.0.7 which left some connections hanging in the connection pool. This was the case at least when a transaction created a new transaction which again needed a db connection. The connection for the "inner" transaction was never closed in the pool.