• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting an exception in Hibernate, was fine till yesterday

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am using Hibernate 3. Tomcat 6.

This is my HibernateUtil

This is in my hibernate configuration
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like you ran out of threads in the pool. Look for unclosed resultset, connections or query statements. Also check for the permission on the database if it is allowing multiple connections from your application user.
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sometimes it can even be a firewall issue. Maybe the firewall settings have changed?
 
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
java.sql.SQLException: DBCP could not obtain an idle db connection, pool exhausted


Looks like you are not closing connections. Prob in the case of exceptions. Where is your close connections code??
 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the replies.

I checked for unclosed connections. There isn't any, at least from the code.

Where is your close connections code??


I close all in the finally block of the code.


Is there any way I can check for open connections?


Sometimes it can even be a firewall issue. Maybe the firewall settings have changed?


Can you elaborate on this please ?

Also check for the permission on the database if it is allowing multiple connections from your application user.


Where do I check for this?

Thanks
 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I changed the settings in the server.xml from

to this

It worked for now. But dont know for long it will work.
Is there any other changes I can make so this does not happen again.

Thanks
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Those are important settings. I think you fixed the problem!
 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Vyas.

Any idea about the best practices for those settings. In a production system would those settings I have given now work?

Thanks
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use the following settings but it depends on your environment and performance aspects. There is no best setting

maxActive="10"
maxIdle="100"
maxWait="3000"
 
reply
    Bookmark Topic Watch Topic
  • New Topic