#114 Properties incorrectly traversed in DataSources.class

closed-fixed
nobody
None
5
2012-12-19
2012-12-17
Jisakiel
No

Using c3p0 0.9.1.2 .

In pooledDataSource( DataSource unpooledDataSource, Properties props ) properties are traversed as a hashmap while peeling the c3p0 ones:

Properties peeledProps = new Properties();
for (Iterator ii = props.keySet().iterator(); ii.hasNext(); ) (...)

This leaves out the possible defaults set inside the properties object (that is, the second hashmap mentioned in the java docs). A better way would be:

for (String propKey : props.stringPropertyNames() ) (...)

I am currently unsure if this happens as well in 0.9.2-preX versions as I am using c3p0 from the maven repositories (directly, without hibernate or spring).

Discussion

  • Steve Waldman

    Steve Waldman - 2012-12-17

    hi,

    i can't use stringPropertyNames() in c3p0-0.9.2-preX, bc 0.9.2 will still support JDK 1./1.5. However, I can use the Properties.propertyNames() enumeration, which does capture default keys. I'll try to do that.

    newer versions of c3p0 are available on Maven, e.g. groupId: com.mchange, artifactId: c3p0, version: 0.9.2-pre7

     
  • Steve Waldman

    Steve Waldman - 2012-12-19

    Fixed as of c3p0-0.9.2-pre8

     
  • Steve Waldman

    Steve Waldman - 2012-12-19
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks