Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-18668

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

    XMLWordPrintable

Details

    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: