Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes 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
Pie
Posts: 20751
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic