This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JDBC and the fly likes JDBC Connection Pool behaviour Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC Connection Pool behaviour" Watch "JDBC Connection Pool behaviour" New topic
Author

JDBC Connection Pool behaviour

Gabriel Beres
Ranch Hand

Joined: Sep 09, 2006
Posts: 61
Hi,

I use JDBC Connections as threadlocal variables. I get the connections from pool (UCP).
Let's assume my application has two threads which are performing many database operations.

In this case i would assume that my used connection count cannot go over 2. In reality it does.
What could be the explanation for this?

Thanks
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2504
    
    8

How have you configured your pool? Min, max, ...


OCUP UML fundamental and ITIL foundation
youtube channel
Gabriel Beres
Ranch Hand

Joined: Sep 09, 2006
Posts: 61
Hi,

Min 1
Max 5
Kuldip Shetty
Ranch Hand

Joined: Jan 07, 2010
Posts: 42

Each time you fetch connection from the pool after performing db operation verify if the connection is released back to the pool by performing connection.close()
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC Connection Pool behaviour