1 Reply Latest reply on Oct 5, 2007 12:06 PM by jaikiran

    EJB3 Persistence Layer and MySQL Timeout

    go_rags

      Hi,

      We are using EJB3 Persistence with MySQL. We are having an issue where the connection is closed by MySQL after the default 8 hours of inactivity. Is there a property that can be set in JBOSS/EJB3 that can keep the connection active using keep alive or something similar.

      I have tried setting the following properties in the EJB3 persistence.properties file. But it did not seem to fix the problem.

      hibernate.connection.autoReconnect=true
      hibernate.connection.autoReconnectForPool=true
      hibernate.connection.is-connection-validation-required=true

      We are using the mysql 3.1 connector, we tried using the mysql 5.0.7 connector as well but still the timeout causes a socket error on the jboss side.

      Can you please let me know what parameters should be set or point me to the right literature.

      Thanks,
      Raghu.