*
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
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: 2491
    
    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: 39

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()
 
 
subject: JDBC Connection Pool behaviour
 
Similar Threads
When to close connection?
Connection pool in Jboss
DataSource Connection is not taking connection from the connection pool - new connection is created
Getting connection from pool?
java jdbc and oracle - maximum open cursors exceeded