Greetings,
I have been tasked with creating some code that will send out notification when we have a database error. I sent a request like like to the CF-Talk list asking if anyone had any suggestions.
We are using ColdBox for this task and the person spot seemed to be here: onApplicationStart
I also found some code that would do exactly what I wanted. See: http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7d48.html
I copied the source word for word and put it in my source. I wanted to make it break to test it.
//Load ColdBox application.cbBootstrap = CreateObject("component","coldbox.system.Coldbox").init(COLDBOX_CONFIG_FILE,COLDBOX_APP_ROOT_PATH,COLDBOX_APP_KEY,COLDBOX_APP_MAPPING); application.cbBootstrap.loadColdbox();application.this_page = “/index.cfm”;
application.this_domain = “#cgi.server_name##Replace (cgi.path_info, ‘/#application.this_page#’, ‘’, ‘ALL’)#”;
application.dsn = “dsn”;
application.app_name = “appname”;
application.application_name = “appname”;
return true;
Please contact support. Application.availableResources=0; Application.counter1=1;
I used a DB by the name of newDB155 as it doesn’t exist and it should make it fail. However, for some reason this works just fine.
Overall, the goal is to make sure we can get a message to the user that there is an issue and to send an email to the developers.
If anyone has any other suggestions, please let me now.
Thanks!