Web app + Tomcat + MS SQL Server + Desktop Applications = Mysterious db write locks every few weeks?
- From: JC <jason.cipriani@xxxxxxxxx>
- Date: Wed, 24 Dec 2008 19:37:31 -0800 (PST)
If this is the wrong place to post this, sorry about that, please let
me know where a better place is.
I have a servlet, running on Tomcat. It uses Hibernate for db access
(using JDBC) and MS SQL Server 2005 as the dbms. There are also some
separate desktop applications that access this database as well.
I'm consistently running into an issue where every week or two,
response times to HTTP requests begin to slow down (I have not been
able to measure it, though), and eventually the desktop applications
start failing on all database insert operations (but they don't fail
on updates!) and reporting that they have "read-only" access to the
database only (I do not know the exact origin of these error
messages).
When the desktop applications start failing, my web application stops
producing output entirely; e.g. it responds with blank documents to
all HTTP requests. However, there should be no code path in the web
application that can lead to blank responses; either the application
produces output or a Tomcat HTTP 500 error page is sent back.
The problem can usually be solved by restarting Tomcat. However,
sometimes, while restarting the web server starts things working
again, it still runs noticeably slow, and the only fix is to reboot
the web server entirely. The SQL server is on a physically different
machine from the web server, as are the desktop applications.
The problem is very hard to debug, and I'm not sure where to start. I
have a few questions that may help me narrow it down:
1) It *appears* that something in the web application is holding an
exclusive write lock on the database, preventing other applications
from inserting new rows into the database. Is there something I could
be doing wrong in the web application with my own code / Hibernate /
JDBC connection settings / etc. that could lead to this happening?
Note that it's literally weeks before it starts happening, but it's
consistent (it's been happening for 2 months). If it was a blatant
error on my part I'd expect it to happen much more often, but I don't
know.
2) Has anybody ever had an issue like this? Even remotely similar,
related to the combination of web applications, Hibernate, Tomcat, MS
SQL, etc, that involve database locks not being released or other
strange things happening after very long periods of time?
Any information at all would be useful. It's tough to debug because
the timescale is so large, and because restarting the web server fixes
it (so it's not possible to update the web app with new debugging
output when it happens).
Again, sorry if this is the wrong place to ask. I figured somebody
here might have some relevant experience, although it does cover a
pretty wide and vague range of topics.
Thanks,
JC
.
- Follow-Ups:
- Prev by Date: JSF code generation
- Next by Date: Re: Another JDBC + MySQL problem
- Previous by thread: JSF code generation
- Next by thread: Re: Web app + Tomcat + MS SQL Server + Desktop Applications = Mysterious db write locks every few weeks?
- Index(es):
Relevant Pages
|