HHH-8302 init c3p0 initialPoolSize with minPoolSize

Adding C3P0_STYLE_INITIAL_POOL_SIZE directly to c3props doesn't work
because of prefix "c3p0."
Using setOverwriteProperty checks for the nullability of the value and
removes this prefix
This commit is contained in:
Laurent RICHARD 2013-06-12 10:53:27 +02:00 committed by Brett Meyer
parent b968048485
commit a300454a85
1 changed files with 2 additions and 2 deletions

View File

@ -196,8 +196,8 @@ public class C3P0ConnectionProvider
// revert to traditional hibernate behavior of setting initialPoolSize to minPoolSize
// unless otherwise specified with a c3p0.*-style parameter.
final Integer initialPoolSize = ConfigurationHelper.getInteger( C3P0_STYLE_INITIAL_POOL_SIZE, props );
if ( initialPoolSize == null && minPoolSize != null ) {
c3props.put( C3P0_STYLE_INITIAL_POOL_SIZE, String.valueOf( minPoolSize ).trim() );
if ( initialPoolSize == null ) {
setOverwriteProperty( "", C3P0_STYLE_INITIAL_POOL_SIZE, props, c3props, minPoolSize );
}
final DataSource unpooled = DataSources.unpooledDataSource( jdbcUrl, connectionProps );