Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Connection pool - check what blocks connections

 
Michal Glowacki
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

I have sometimes a problem with connections being blocked in pool. I use JBoss AS and Postgres, connection pool with standard params: max size 100, blocking timeout 30000ms. Usually I see that 0-5 connections are in use, but there are moments (once per few days, but as I keep getting more and more visitors it's more often now) when I got 60, and even 100 and start getting 'no managed connections available' error. Flushing pool helps.

Probably some parts of the code are blocking connections. How can I find them?

Regards,
Michal
 
Scott Selikoff
author
Bartender
Posts: 4033
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd guess there are cases where connections aren't properly closed. All places where connections are established should be followed by a finally {} block that closes the connection.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!