• Post Reply Bookmark Topic Watch Topic
  • New Topic

JDBC Connection Pool behaviour

 
Gabriel Beres
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2620
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How have you configured your pool? Min, max, ...
 
Gabriel Beres
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Min 1
Max 5
 
Kuldip Shetty
Ranch Hand
Posts: 45
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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()
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!