Issue

Occasionally RemoveOnException errors may appear in the ColdFusion logs, masking a real database issue. RemoveOnException is a data source level setting used to determine whether to throw away broken data source connection from the JDBC pool.

The RemoveOnException setting is set to true by default in ColdFusion MX. It is enforced when a pooled JDBC resource has a connection related exception, such as the loss of physical connection to a database by a network failure. The connection is removed from the pool and a new connection is created the next time the data source is accessed. You may see an error similar to the following in the serverlog (cf_root\logs\server.log):

removeOnExceptions is true for playGround, closed the physical Connection removeOnExceptions is true for playGround, closed the physical Connection removeOnExceptions is true for PSDB, closed the physical Connection removeOnExceptions is true for PSDB, closed the physical Connection

You may receive multiple entries for a data source depending on the size of the connection pool. Disable this setting to uncover any specific database connection errors.

Solution

Disable connection pooling for the affected data source.

ColdFusion MX 6.1 & MX 7

  1. Access the Data Sources page in the ColdFusion MX Administrator.
  2. Click on the name of the affected data source.
  3. Click Show Advanced Settings.
  4. Clear the checkbox next to Maintain Connections.
  5. Click Submit.

ColdFusion MX

Warning: The following steps require you to edit one or more of the ColdFusion MX configuration files. Incorrect modifications can cause serious server instability. Ensure you have a current backup of the file(s) for recovery.

  1. Shut down ColdFusion MX.
  2. Editcf_root\runtime\servers\default\SERVER-INF\jrun-resources.xml.
  3. Find the entry for the affected data source. Using an XML editor will facilitate the process.
  4. Set the removeOnException setting to false.
  5. Save jrun-resources.xml.
  6. Start ColdFusion MX.

Note: Editing this data source with the ColdFusion Administrator will reset the value for removeOnException to true, requiring a repeat of the above steps to disable the setting again.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy