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

Review all DB configuration documents regarding the Test On Borrow parameter

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Fixed
    • None
    • Documentation - All
    • None
    • 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.

      The Tuning Database Connections document states the following on the pool-test-on-borrow parameter:

      Recommendation / Notes
      This value should always be 'false' as JIRA borrows a connection for each database operation.

      If you continue to have problems with database connections closing, try setting this option to 'true'. However, this should only be used as a last resort and only in the event that decreasing the value of Time Between Eviction Runs has not reduced or prevented problems with database connections closing.

      Default value
      false
      (when not specified in dbconfig.xml)

      However, looking into the Apache DBCP Documentation, we can see that the default value for this option is true:

      Parameter Default Description
      (...) (...) (...)
      testOnBorrow true The indication of whether objects will be validated before being borrowed from the pool. If the object fails to validate, it will be dropped from the pool, and we will attempt to borrow another.

      This means that the validation query is executed every time a connection is borrowed from the pool.

      I have confirmed this behaviour by enabling SQL logging on PostgreSQL and confirming the validation query was executed every time a query was triggered from JIRA.

      We should review our documents which provide a sample dbconfig.xml with a validation query, as this parameter (<pool-test-on-borrow>) should be explicitly declared as false in those examples:

      I will also update the Tuning Database Connections document to correct parameter value there.

      Attachments

        Issue Links

          Activity

            People

              dconrad Danilo Conrad
              dconrad Danilo Conrad
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: