Reset Access Datasources Without Resetting ColdFusion
I am “stuck” with a few web applications that provide web front-ends to Access databases. I am not the owner of these databases, and for various reasons, the database owner will not upgrade it to SQL Server. Alas, this sometimes causes headaches like the following.
The Access databases are on a network fileserver. Occasionally, this server goes down or resets, and ColdFusion’s datasource connection to the database gets stuck in a disrupted state. I’ve come to learn two things you can try to get ColdFusion’s connection to the Access datasource working again without resetting the entire ColdFusion Application Server service, which is obviously disruptive to your entire site and all of its applications.
- Reset the ODBC services. The ColdFusion ODBC services (such as “ColdFusion 8 ODBC Agent” and “ColdFusion 8 ODBC Server”) actually handle the ODBC connections to DataDirect driver databases such as Microsoft Access databases. This is handy. Just reset these services and often connectivity is restored.
- Use the “Disable Connections” option in the datasource configuration. If you are using JDBC drivers (for instance, perhaps to connect to Microsoft Access 2007 databases), resetting the ColdFusion 8 ODBC Server service won’t help. Darn. However, if you go into the datasource’s configuration in ColdFusion Administrator, you can check the “Disable Connections” checkbox and submit the change. This will force ColdFusion to disconnect from the database. Immediately go back in and uncheck the checkbox and submit again. Your datasource will now have connectivity reestablished without a ColdFusion restart!
Happy days! The second option won’t be helpful to you if you have many, many datasources. However, this is better than a ColdFusion reset that would disrupt all of your apps.

March 24th, 2009 at 11:59 am
You can also use the CF service factory to restart the datasources:
I keep a page with this code handy to quickly restart the datasources if things go awry.
March 24th, 2009 at 12:00 pm
OK, that didn’t work…
<cfobject type=”JAVA”
action=”Create”
name=”factory”
class=”coldfusion.server.ServiceFactory”>
<cfset dsService = factory.DataSourceService>
<cfset dsService.restart() />
March 24th, 2009 at 12:40 pm
Awesome. Thanks for sharing.
March 24th, 2009 at 6:09 pm
It’s been a really, really long time since I’ve had to deal with this issue, but I know there was a time (pre cfmx) that if you wrote a query that errored out it would reset that datasource. It was a great little secret. I have no idea if it still works though.
August 24th, 2009 at 10:44 pm
great tips. I enjoyed reading this
September 30th, 2009 at 4:40 pm
great article. I will bookmark this
October 31st, 2009 at 6:22 pm
ColdFusion offers a Simplified database access, which really helps me with workflow.
December 9th, 2009 at 7:52 pm
Great tips. Happy Holidays. http://www.on3solutions.com