Improve database startup checks to catch SQLException when asking for the Connection

XMLWordPrintable

      NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? See the corresponding suggestion.

      When starting up if the database is not available, we log it in the database consistency check, but then carry on. We call it later and the resulting exception completely stops the application from loading. Doing the check means JIRA will at least startup locked and show the error.

      Propose adding the following to the beginning of DatabaseConsistencyCheck.isOk()

      DatabaseConsistencyCheck {
          ...
          public boolean isOk()
          {
              try
              {
                  jiraConnectionFactory.getConnection();
              }
              catch (final SQLException e)
              {
                  final String message = "Cannot get connection to the database";
                  log.error(message, e);
                  faultDescription = message + ": " + e;
                  faultDescriptionHtml = faultDescription;
                  return false;
              }
              ...
          }
      

      We need to test this on the supported application servers (especially JBoss) due to previous experience of funkiness in this area.

            Assignee:
            Unassigned
            Reporter:
            Jed Wesley-Smith (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: