Flush active database connections
Is there any way to clear all cached database connections, i.e., those with 'Maintain Connections' enabled? I'd like to do this without:
- Restarting the ColdFusion Application Server service
- Having to use the cfide.adminapi.datasource API to update every data source
- Disabling persistent connections (the Maintain Connections setting on the data source)
The first option would terminate all sessions. The second option requires disabling and re-enabling the 'pooling' attribute on every data source. The third option would impact performance.
CF 4.x and 5.x had an undocumented function called 'cfusion_dbconnections_flush()' that served this purpose but it no longer exists.
Background: we use a lot of Oracle packages and sometimes they need to be recompiled. The first time a recompiled package is invoked by a CFML template it will throw the exception 'ORA-04068: existing state of packages has been discarded'. After the initial error the package is fine and executes normally. When persistent connections are disabled the error does not occur at all. We are using ColdFusion 9.0.1 on Windows 2003/IIS.
Thanks,
Michael Mongeau
Stratus Technologies
Maynard MA
