-->
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.  [ 11 posts ] 
Author Message
 Post subject: Which connection pool is best?
PostPosted: Mon Oct 13, 2003 1:37 am 
Pro
Pro

Joined: Tue Aug 26, 2003 8:07 pm
Posts: 229
Location: Brisbane, Australia
I've just discovered that our application currently uses the default Hibernate DriverManagerConnectionProvider class for connection pooling.

It hasn't caused any problems for our application as yet. But the API doco for that class refers to the connection pooling logic as "rudimentary" and I'm pretty sure I've seen Gavin say something like "just don't" :)

So I'm wondering, which one should I recommend we change to?

The GPL nature of c3p0 doesn't really bother us, and I think I've seen people post about issues with DBCP before (here and on the Jakarta commons mailing list).
So I'm thinking of just recommending c3p0 and getting on with the job.
Does anyone here have any recommendations or thoughts?

Cheers,
Shorn.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 13, 2003 2:26 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Use C3P0.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 13, 2003 2:45 am 
Pro
Pro

Joined: Tue Aug 26, 2003 8:07 pm
Posts: 229
Location: Brisbane, Australia
I looked at the C3P0 sourceforge site and it says it's a beta project (including in the release notes of the latest release that doesn't say "test" :).
The C3P0 web page also says there's only one developer, whereas the DBCP project is an Apache project (admittedly only sort-of, I guess it's technically a sub-sub-project of Apache).

The DBCP project also has a new 1.1 version coming out fairly soon.
I know DBCP is fairly active because I see activity on the commons mailing list; unfortunately all the activity I can recall seeing was related to "issues" :)

But then again, C3P0 is the one that ships with Hibernate. It also seems to have a fairly high activity percentile.

And, of course, we can always just chuck in a new one in if the one we choose doesn't work, or even write our own. But the kind of prodcution issues that occur because of bad object pooling code can be... problematic to track down, so it would be better to get this choice as right as possible.

I guess when my boss asks me I can just say "Coz Christian said to" :), but I was hoping someone might have some pros and cons based on their experiences.

And yes, he will ask. He's annoyingly competent like that :)

Sorry for all the smileys, it's that kind of day.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 13, 2003 3:10 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Well, a good reason to use CP30 would be the "it's an apache project" issue. I remember we had a discussion like that some time ago, just search the forum.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 13, 2003 3:38 am 
Pro
Pro

Joined: Tue Aug 26, 2003 8:07 pm
Posts: 229
Location: Brisbane, Australia
Well, okay.
I found this topic - http://forum.hibernate.org/viewtopic.php?t=10, I assume that's the one you're referring to.
(I've been looking for issues on the old forum, I kinda figured this would be an old issue D'oh!)

So..... I think I'll go with C3P0 :)

Thanks for the help.


Top
 Profile  
 
 Post subject: Re: Which connection pool is best?
PostPosted: Mon Oct 13, 2003 5:09 am 
Senior
Senior

Joined: Wed Aug 27, 2003 6:04 am
Posts: 161
Location: Linz, Austria
stolley wrote:
The GPL nature of c3p0 doesn't really bother us, and I think I've seen people post about issues with DBCP before (here and on the Jakarta commons mailing list).


You mean, you simply ignore the GPL conditions? ;-) I've just discovered that C3P0 is LPGL now -- a welcome change! It also offers a bean-style ComboPooledDataSource as of 0.8.4, a la DBCP's BasicDataSource.

I believe that Commons DBCP has been beaten too much, though. We've been using Commons DBCP for quite a while, and it works nicely so far. It may have its flaws, but it is being actively developed, and 1.1 RC1 seems to address quite a lot of issues.

No offence to Steve of C3P0, but how can one be *sure* that C3P0 doesn't have the same amount of flaws? It might just not have come to the surface yet because less people are using it. Of course, I don't assume that: I consider C3P0 a fine component too.

The really sad thing is that we still have to argue about stable connection pool implementations in late 2003...

Juergen


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 13, 2003 5:12 am 
Regular
Regular

Joined: Tue Aug 26, 2003 6:59 pm
Posts: 89
Location: Somewhere in the Ghetto
i want to use c3p0 too, what are some of the suggested default settings for c3p0?

I read in the docs all I had to do was set hibernate.c3p0.* properties but what keys and values should I use?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 13, 2003 5:13 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
The values matching your specific environment.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: Re: Which connection pool is best?
PostPosted: Mon Oct 13, 2003 8:13 pm 
Pro
Pro

Joined: Tue Aug 26, 2003 8:07 pm
Posts: 229
Location: Brisbane, Australia
jhoeller wrote:
You mean, you simply ignore the GPL conditions? ;-)


Pretty much. The application I'm working on is just custom software built to be used in-house. As far as I'm aware, the GPL doesn't have too much effect on these kinds of projects as it'll never be distributed and we won't be working on the actual c3p0 code base.

An even if the company did decide to release the software, then they'd just have to use a non-GPL connection pool (maybe even Hibernate's) or write their own. Seems more than fair to me.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 14, 2003 1:26 am 
Pro
Pro

Joined: Tue Aug 26, 2003 8:07 pm
Posts: 229
Location: Brisbane, Australia
Are there any plans for the Hibernate C3P0ConnectionProvider to support the C3P0 "idleConnectionTestPeriod"?
As opposed to the C3P0 "testConnectionOnCheckout" property which is supported by the "hibernate.c3p0.validate" property.

It just seems like the idleConnectionTest is a much better plan than running a test everytime you checkout a connection (which would be just too expensive I would've thought, and so the C3P0 doco implies).

Is it a good idea or would an enhancement request (or patch) to extend the C3P0ConnectionProvider be rejected?
Is eveyone happy with testing each connection for every checkout or does no-one use it at all?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 14, 2003 11:01 am 
Regular
Regular

Joined: Fri Sep 05, 2003 12:01 am
Posts: 80
Location: Bogot
I've been using hibernate with connection pools defined in Jboss in medium size applications and production environments for a while and so far so good! Haven't had any problems at all.

Hope it helps!

_________________
Mauricio Hern


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 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.