This page last changed on Oct 18, 2006 by david.soul@atlassian.com.

I am using MySQL, and after a while Confluence stops working with database errors.

MySQL's JDBC drivers have an annoying default behaviour where if a connection is idle for a certain amount of time (by default, eight hours), it is closed. Since Confluence uses a connection pool, this means that pooled connections die if they are not used within a certain time period.

The solution is to append ?autoReconnect=true to the end of your database's JDBC URL.

  • If you are using JNDI data-sources, you will do this in your application server's configuration files.
  • If you have configured Confluence to access the database directly, you will need to manually edit the hibernate.connection.url property in the confluence.cfg.xml file in your confluence.home directory. After you have changed the URL in this file, restart Confluence.
Note

In Confluence versions 1.0RC5 and before, there was a bug that manifested when you used Confluence to connect directly to a MySQL database instead of going through a datasource configured in the application-server under which Confluence runs. Unfortunately the symptoms of the bug were identical to the much more common problem above, so it took us a little longer to find the problem than we should have.

So long as you specify autoReconnect=true, Confluence 1.0RC6 and later should remain connected to your MySQL database indefinitely.

 

RELATED TOPICS

Configuration Guide
[FAQ Home]

Document generated by Confluence on Jun 24, 2008 18:05