This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Tomcat hangs due concurrent db-queries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat hangs due concurrent db-queries" Watch "Tomcat hangs due concurrent db-queries" New topic

Tomcat hangs due concurrent db-queries

Kari Surakka

Joined: Jan 13, 2008
Posts: 1

I have Tomcat5.5 running on virtual server(Debian). Tomcat hangs when I make to two/more concurrent heavy-db-using http-request with browser. By hanging I mean that tomcat accepts new http-requests but does not reply to them anymore. Db-query that tomcat executes is select that returns many rows(just to make sure they executes concurrently) but otherwise it is very simple.

When tomcat hangs one tomcat(java) process start slowly increasing cpu-usage(eventually to 99%). Tomcat cannot be terminated by "kill -3" signal.

I have tested this with Postgresql and mysql, direct JDBC connection/hibernate, pooling/no pooling. Pure java-application(no Tomcat) works fine with many concurrent queries.

All ideas are very welcome, thanks
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12761
The obvious question is - how does your servlet manage DB connections? Are you using a connection pool?

I agree. Here's the link:
subject: Tomcat hangs due concurrent db-queries
Similar Threads
SCEA Part1 EPractize Labs - some answer seems incorrect
Using Excel as DataBase, creating tables inside .xls
How to timeout Tomcat request?
Remote JDBC connection performance question
native methods