-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: How to make sure c3p0 is working? Stuff in System.err...
PostPosted: Fri Apr 29, 2005 11:02 pm 
Beginner
Beginner

Joined: Fri Apr 29, 2005 10:57 pm
Posts: 41
Hibernate version: 3

Everything works fine, but I'm not sure if the c3p0 db connection pool is working properly. I have it set up as the following in my .xml:


Code:
<property name="hibernate.c3p0.min_size">5</property>
        <property name="hibernate.c3p0.max_size">20</property>
        <property name="hibernate.c3p0.timeout">1800</property>
        <property name="hibernate.c3p0.max_statements">50</property>


And every time I start up my web app, I see the following in my System.err stream (which is a file):

Code:
Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@f0b7f8 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@17ba38f [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, idleConnectionTestPeriod -> 0, initialPoolSize -> 5, maxIdleTime -> 1800, maxPoolSize -> 20, maxStatements -> 50, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@1e13e07 [ description -> null, driverClass -> null, factoryClassLocation -> null, jdbcUrl -> jdbc:mysql://xxx.xxx:3306/xxx, properties -> {user=******, password=******} ] , preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ] , factoryClassLocation -> null, numHelperThreads -> 3, poolOwnerIdentityToken -> f0b7f8 ]
Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@1eb904d [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@137d4a4 [ acquireIncrement -> 1, autoCommitOnClose -> false, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, idleConnectionTestPeriod -> 0, initialPoolSize -> 5, maxIdleTime -> 1800, maxPoolSize -> 20, maxStatements -> 50, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@4eeaaf [ description -> null, driverClass -> null, factoryClassLocation -> null, jdbcUrl -> jdbc:mysql://xxx.xxx:3306/xxx, properties -> {user=xxx, password=xxx} ] , propertyCycle -> 300, testConnectionOnCheckout -> false ] , factoryClassLocation -> null, numHelperThreads -> 3 ]



Yes, this is extremely ugly. This is just a copy/paste of what I see. Any clues?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 01, 2005 5:05 am 
C3P0 Developer
C3P0 Developer

Joined: Tue Jan 06, 2004 8:58 pm
Posts: 145
Lasek,

This is normal, and however ugly, okay. c3p0 0.8.x logs to System.err, and more recent versions output a config dump on initialization. (Two pools are being initialized in the quoted log. Is that expected?)

If you prefer logging messages to go via log4j or jdk14logging, please upgrade to the latest version of c3p0-0.9.0-preX. pre5 is the current public release, and is near release quality.

smiles,
Steve (c3p0 guy)


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 02, 2005 5:12 pm 
Beginner
Beginner

Joined: Fri Apr 29, 2005 10:57 pm
Posts: 41
2 pools are because I have 2 applications on the server.

And where is the c3p0 official website?

It just seemed wierd that it's being written into system.err... why not system.out?

Also, does c3p0 have anything to do with that robot on the star wars?


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 03, 2005 4:03 am 
C3P0 Developer
C3P0 Developer

Joined: Tue Jan 06, 2004 8:58 pm
Posts: 145
re: why System.err -- because in the days before log4j et al, System.err served as a convenient place for logging messages that could be turned off or redirected to a file without affecting the core output of an application (which could, after all, be a console-based app).

re: why c3p0? mostly because it began as an attempt to see how hard it would be to implement connection pooling as defined by the JDBC 3.0 specification. Connection Pooling 3.0 --> cp30 --> c3p0. Also, I was working on a (never completed, and now obseleted) project for easy-to-use access to berkeley db from java, and that was called bdbd. A robot in an old television show (Buck Rogers) always said "bdbd", and c3p0 was a robot too. The pairing of names was a private little joke.

re: c3p0 website? there's not much of one. There's the sourceforge project page at http://sourceforge.net/projects/c3p0/, and you can see the docs at http://www.mchange.com/projects/c3p0/index.html

smiles,
Steve


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 03, 2005 2:29 pm 
Beginner
Beginner

Joined: Fri Apr 29, 2005 10:57 pm
Posts: 41
I'll check it out..

By the way, is there like a guide on what DB pool I should use? I'm purchasing the Hibernate bible today, hopefully it will have some insights...

It's just that, there are hundreds of pools floating around (hell even I made my own), just not sure what's the best.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.