Meaningless Drivel is fun!*
The moose likes JDBC and the fly likes jdbc connection pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "jdbc connection pooling" Watch "jdbc connection pooling" New topic

jdbc connection pooling

pradeep arum
Ranch Hand

Joined: Oct 01, 2003
Posts: 130
Hi all, I have a situation where there are 3 applications , which are just components , I mean which do not run under any application server, So I need to create a component for all the 3 apps to use a connection pool, and all the 3 apps should use the connection pool component , I mean as one point of control to the database , supplying individual jars wont solve this problem, I guess, then it becomes 3 point of entry's.Please share your thoughts on how to make this possible.


Failure is not when you fall down; its only when you fail to get up again.
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30068

Why can't you have 3 connection pools?

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
pradeep arum
Ranch Hand

Joined: Oct 01, 2003
Posts: 130
I just gave an example of 3 applications, in future there can be 'n' applications , and I guess there can not be 'n' connection pools , and since the database can not scale 'n' * 50 connections, incase the connection pool component holds a MAX of 50 connections in the worst case.

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

and since the database can not scale 'n' * 50 connections

Why not?

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ashutosh Gawande

Joined: Aug 19, 2009
Posts: 11
Hi Praddep,

I have some doubt over the design.

1. If you implement one connection pool for all of them then you will not able to secure some connection for each application, i.e. a situation may arise that all the connections are used up by one application and other two are not getting any chances (This depends on traffic expected)

2. So if you can take into account above you pretty much cannot guarantee the performance and availability of any of the application.

Instead I will suggest analyse the traffic expected on each application, hence possible load on database in peak time. Depending on above you will have a better chance of maintaining SLA for the application at least from db access point of view. Using this data create three different resource pools setting up min and max connections on each application separately.

I can see the point of single access but if the concern is max number of connections created on DB side, this can be controlled in much simpler way.

pradeep arum
Ranch Hand

Joined: Oct 01, 2003
Posts: 130
Thanks Paul,Ashutosh,Jeanne,
Understood all your thoughts, Will talk to my architect and see why he wants one point of entry into the pool, and will get back to you.

Thanks for your time.
pradeep arum
Ranch Hand

Joined: Oct 01, 2003
Posts: 130
Hi all,
I have found something that might be of interest to you guys,, it is an rmi based call to get a connection object.Please let me know what you think abt it, I have created a sample pilot and seems to work fine, I am not able to think beyond what it does, Please advice / suggest what you think about it.

I agree. Here's the link:
subject: jdbc connection pooling
Similar Threads
Connection pooling design pattern
getConnection() from datasource is occasionally taking a very long time
User credientials doubt
DB connection pool per webapp if defined in context.xml?
what connection pooling is better?