HHH-6635 C3P0: hibernate.c3p0.* configuration properties not properly parsed

This commit is contained in:
Strong Liu 2011-09-07 16:12:22 +08:00
parent 102f9b3876
commit fcf43b2933
1 changed files with 3 additions and 2 deletions

View File

@ -165,7 +165,7 @@ public class C3P0ConnectionProvider implements ConnectionProvider, Configurable,
for ( Iterator ii = props.keySet().iterator(); ii.hasNext(); ) {
String key = ( String ) ii.next();
if ( key.startsWith( "hibernate.c3p0." ) ) {
String newKey = key.substring( 10 );
String newKey = key.substring( 15 );
if ( props.containsKey( newKey ) ) {
warnPropertyConflict( key, newKey );
}
@ -239,7 +239,8 @@ public class C3P0ConnectionProvider implements ConnectionProvider, Configurable,
private void setOverwriteProperty(String hibernateStyleKey, String c3p0StyleKey, Map hibp, Properties c3p, Integer value) {
if ( value != null ) {
c3p.put( c3p0StyleKey, String.valueOf( value ).trim() );
String peeledC3p0Key = c3p0StyleKey.substring(5);
c3p.put( peeledC3p0Key, String.valueOf( value ).trim() );
if ( hibp.containsKey( c3p0StyleKey ) ) {
warnPropertyConflict( hibernateStyleKey, c3p0StyleKey );
}