Database connection error

Database connection error

  

Is it possible to catch database connection error when the server is not available. There is an aggregate in a screen preparation I want to catch when the database server is not available, but the error is not caught in the local action nor the OnException in Common UI flow.

Version 10.0.807.0

Hi Stanley,

With Web Apps the Platform assumes the database is always available. So I don't think it's possible to gracefully catch a situation where it isn't.

This is definitely less than desirable. 

Here is my solution: create a REST API to query the database, call the API in the screen preparation and caught the REST API exception.

Hi Stanley,

Not sure whether that would work. The Platform accesses the database when the screen starts, you'll be "dead" before you get a chance to even call the REST API. Also, if you have database connection problems on a regular basis, your infrastructure is botched, and there's better things you can do than call REST APIs in every screen...

Solution

I think setting up a simple monitoring solution with a good followup is the way to handle this. Like Kilian was saying Outsystems uses more db actions even before the page is going to the preparation so probably you will get a nice IIS error page.

Solution

Hi Kilian and Peter,

Thanks for your replies. 

I should state the database is external, not the native database. Of course it cannot be done within the application for the native database, but my solution works for external databases.

Cheers!