Site behavior when unable to connect to database
Site behavior when unable to connect to database
I have my Ablecommerce website on one server and the database on a different server. If the webserver is unable to establish a connection to database server, I'd like to trap that and redirect the user to an informative page. I am thinking that I could trap at the point where the initial db connection is made to load the store settings, but I can't find that point in the code. Where does Ablecommerce make the first db connection attempt?
Re: Site behavior when unable to connect to database
That is somewhere in the back-end code.
What you can do I guess is to trap the SQL exception in Global.asax and redirect the user to the info page.
What you can do I guess is to trap the SQL exception in Global.asax and redirect the user to the info page.
Re: Site behavior when unable to connect to database
What are the error details that you get in unavailable case of database server. I think you can try to catch error in Global.asax file's Application_Error method. Where you can try to parse the exception and see if its related to availability of database server then redirect to desired page.
Re: Site behavior when unable to connect to database
Mazhar,
In my case the port was blocked at the firewall by mistake. All I received was: "Internet Explorer Cannot Display the Webpage". It appears that Ablecommerce isn't rendering anything until the database can be queried for the store settings. Where does Ablecommerce make the intial db connection?
In my case the port was blocked at the firewall by mistake. All I received was: "Internet Explorer Cannot Display the Webpage". It appears that Ablecommerce isn't rendering anything until the database can be queried for the store settings. Where does Ablecommerce make the intial db connection?
Re: Site behavior when unable to connect to database
The connection is made in back end code (dll) file.