-->
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.  [ 4 posts ] 
Author Message
 Post subject: Connection Pooling using C3P0ConnectionProvider
PostPosted: Thu Jun 17, 2004 8:13 am 
Newbie

Joined: Fri May 21, 2004 2:59 am
Posts: 12
I am using Hibernate with Jboss and PostgreSQL.
In connection pooling I am using C3P0ConnectionProvider class.

It is working fine.

CASE 1:

While configuring I have mentioned the min pool size as 5
and max pool size as 40.

It is not displaying the connection pool size in console.

How can know the Connection Pool size in this case?

CASE 2:

In this case I gave min size as 70 and max size as 0.

This case also working.

How this is possible.

What exactly happens?Does the min size and max size specification have any impact or not?


-------------
Manohar


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 18, 2004 7:37 am 
Beginner
Beginner

Joined: Tue Feb 10, 2004 2:30 pm
Posts: 25
The only way to find out is to read the source of Hibernate and C3P0 - both are available on SourceForge.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 21, 2004 12:14 am 
C3P0 Developer
C3P0 Developer

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

c3p0 does not dump the connection pool size to the console or log, unless you edit the source to put it in debug mode with maximum tracing. The pool size may change frequently. To check the pool size, cast your DataSource to the PooledDataSource interface and call the appropriate method. (See the docs and javadocs.)

c3p0 does indeed pay attention to the parameters you supply, but does not check and warn you if you supply foolish or inconsistent parameters. If you provide a minimum size of 70 and a maximum size of 0, c3p0 will (dutifully) acquire 70 initial connections, but will never acquire another Connection, even if some die and the count goes below 70, because the size will always be above the maximum size.

I can add some sanity checks, but it's not been a priority. If you use sane values and documented special values, c3p0 will honor them. If you use unreasonable values, c3p0's behavior is, um, "undefined".

smiles,
Steve


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 21, 2004 12:59 am 
Newbie

Joined: Fri May 21, 2004 2:59 am
Posts: 12
Thanks alot

---------------
Manohar


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.