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

java.sql.SQLException: DBCP could not obtain an idle db connection, pool exhausted

 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I use hibernate framework.
I looked for any unclosed connections in the code. I couldnt find any.
How can I find out what is causing it.

Thanks
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have a connection leak or there are not enough connections in the pool. Increase the pool size and check if the exception persists. If it does, track the number of open connections and code flow to reveal where the leak (if there is one) occurs
 
Rob Spoor
Sheriff
Posts: 20827
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although Deepak is probably right; you should always close your Connections (and (Prepared)Statements, ResultSets, Readers, Writers, InputStreams, OutputStreams, etc) when you're done with them, preferably in a try-finally block:

Moving to our ORM forum.
 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you!
 
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!