• 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

DBCP deadlock on BasicDataSource.getConnection()

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anyone ever seen this before? A bunch of threads in Tomcat is stuck trying to get a connection:



Seems like its a deadlock, but I'm not sure how this is happening.
 
Greenhorn
Posts: 9
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dennis,

This normally means that your Tomcat Pool is running out of Connection. At that point Tomcat ObjectPool code will start to wait until a Connection is available.

Do you see other Threads involved in actual database transactions or just waiting to acquire a Connection? Also, what are your current Tomcat settings for this particular data source?

Possible scenarios:

- Database hanging scenario causing rapid depletion of your Tomcat JDBC Data Source (long running query, database slowdown condition, too much load vs. tuning etc.)
- JDBC DataSource/Connection leak

At this point, please provide more detail on other Threads from your captured Thread Dump so we can pinpoint the root cause as per process below:

- Breakdown Thread Dump in logical silos:
- What is the total # of active Threads (executing a request)
- What is the total # of Threads waiting to acquire a Connection from your JDBC DataSource
- What is the total # of Threads involved in an actual transaction with your JDBC DataSource
 
Dennis Franklin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Pierre-Hugues for the insight. I had completely forgotten to set the connection pool size settings. Added maxActive and maxIdle resolved the issue.

Just out of curiosity, what's the default maxActive if it is not set?
 
The longest recorded flight time of a chicken is 13 seconds. But that was done without this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic