Details
-
Suggestion
-
Resolution: Obsolete
-
None
-
2
-
32
-
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
- is related to
-
CONFCLOUD-40336 Change C3P0 defaults for idle_test_period
- Closed
-
CONFSERVER-40336 Change C3P0 defaults for idle_test_period
- Closed
-
BDEV-12123 Loading...
- mentioned in
-
Page Loading...