File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Connection Pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connection Pooling" Watch "Connection Pooling" New topic
Author

Connection Pooling

Supri dharshni
Greenhorn

Joined: Jul 14, 2009
Posts: 25
Hi,

Instead of creating and opening new connections for each and every request we have the connections in a connection pool.But what happens when the number requests exceeds the pool size limit.Will any exception is thrown? If so then how we have to handle such situation.Please reply.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

What sort of connections?
The best answer is 'it depends'.

It is acceptable to force a thread to wait if a connection is not available, but a Thread should not be starved and should not be forced to wait forever.
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

Most of the times the connection pool object would have this documented. Most of the time I suspect they wait put you in wait with some timeout. All of this is configurable. Most of the times the max required connection can be safely set. If not most connection pool allow you to set maxConnection to no limit.

P.S - When I say connectionPool I mean a DataBase Connection Pool.


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Hardik N Shah
Greenhorn

Joined: Jul 14, 2010
Posts: 7
Apache Common DBCP manages all this things very well


Hardik Shah
Java/J2ee Expert
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection Pooling
 
Similar Threads
Connection Pooling
Java Database connection
Doubt in Connection Pooling
Closing of connection object in Stateless Session Beans
How do the connections get closed in Connection Pool