Hi,
I've a web app developed with Hibernate 1.2. When a user tries to log in after a long period of inactivity, I get the following exception:
java.sql.SQLException: No operations allowed after connection closed
I understand that MySql shuts off connections after 8 hours. I tried setting the DBCP validation query, and even specifying the "autoreconnect" parameter in the JDBC URL. No luck. Anyone have any ideas?
Code:
hibernate.dbcp.validationQuery = Select 1
hibernate.dialect = cirrus.hibernate.sql.MySQLDialect
hibernate.connection.driver_class = com.mysql.jdbc.Driver
hibernate.connection.username =XXX
hibernate.connection.password =XXX
hibernate.connection.url = jdbc:mysql://localhost/dbname?autoReconnect=true
P.S. This seems to work ok in my Hibernate 2.0.2 based app. I'm reluctant to spend the effort to upgrade this older project unless I really need to, though.
Thanks, WILL