Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JDBC Connection Pool behaviour  RSS feed

 
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: 2628
17
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()
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!