Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-17900

C3P0 settings should be corrected

    XMLWordPrintable

Details

    • 2
    • 32
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Problem Definition

      Update

      This default C3P0 default setting needs to be updated:

      • hibernate.c3p0.idle_test_period should be lower than hibernate.c3p0.timeout.

      Add

      Idle connections are not tested since hibernate.c3p0.validate does not exist. This property is recommended by Confluence
      https://confluence.atlassian.com/display/DOC/Surviving+Database+Connection+Closures

      Suggested Solution

      Configure C3P0 by default as such:

      <property name="hibernate.c3p0.acquire_increment">1</property>
      <property name="hibernate.c3p0.idle_test_period">29</property>
      <property name="hibernate.c3p0.max_size">100</property>
      <property name="hibernate.c3p0.max_statements">0</property>
      <property name="hibernate.c3p0.min_size">0</property>
      <property name="hibernate.c3p0.timeout">30</property>
      <!-- Different database types have slightly different SQL syntax requirements for their validation query. The validation query should be as simple as possible, as this is run every time a connection is retrieved from the pool. The following validation queries are recommended for the following types of databases:
      
      MySQL: select 1
      Microsoft SQL Server: select 1
      Oracle: select 1 from dual
      PostgreSQL:select 1
      --?
      <!-- 
      <property name="hibernate.c3p0.validate">true</property>
      <property name="hibernate.c3p0.preferredTestQuery">enter_DB_specific_validation_query_here</property>
      -->

      Notes

      • When setting idle_test_period greater than the timeout idle connections will never be tested because they will be removed from the pool after 30 seconds.
      • The default setting for validate is non-existent so idle connections will never be checked with default configuration in place.

      These are the current default settings:

      <bamboo-home>/bamboo.cfg.xml
      <property name="hibernate.c3p0.acquire_increment">1</property>
      <property name="hibernate.c3p0.idle_test_period">100</property>
      <property name="hibernate.c3p0.max_size">100</property>
      <property name="hibernate.c3p0.max_statements">0</property>
      <property name="hibernate.c3p0.min_size">0</property>
      <property name="hibernate.c3p0.timeout">30</property>
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rsperafico Rafael Sperafico (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: