Re: Web app + Tomcat + MS SQL Server + Desktop Applications = Mysterious db write locks every few weeks?



Thanks a lot, I really appreciate your reply.


On Dec 29, 3:02 am, neune...@xxxxxxxx wrote:
Hi,

On Dec 25, 3:37 am, JC <jason.cipri...@xxxxxxxxx> wrote:
...

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?

Well, I've experienced and fixed that *kind* of behavior
6 months ago or so.

It is a (not well-known) *fact* that there are issues involving
Hibernate and the Sun VM.

In my case it was a very weird PermGen space error (weird because
there was plenty or PermGen memory) fixed simply by passing the
following parameter "XX:MaxPermSize=256m" (IIRC).

You know, come to think of it, I have seen the web application run out
of permgen space on the development machine in the past, even though I
felt like it shouldn't have (I was dealing with small amounts of data,
and this web application is relatively simple, nothing exotic), but I
chalked it off to other things at the time, and it was very rare. I
never thought about it again. I wonder if it is similar to what's
going on on the production machine.


The behavior was as you describe: restarting Tomcat would fix the
problem...  For a few weeks.

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).

Because restarting the web server in our case "fixed"
the problem and because having customers was more
important than having the "perfect application
running on a perfect VM in a perfect OS etc." we first
scheduled an automatic Tomcat restart every 72 hours ;)

This was a crappy fix, but for our startup it was better
than to be out of business.

Agreed; although it will be good to find out if it's a bug in third-
party software rather than a bug in our own software. The former can
be acceptably "solved" with automatic restarts, the latter should
probably be solved at the root cause instead.


Later on I found the exact cause of our problem: a weird
Hibernate + Sun VM (known and documented) bug (Google is
your friend) easily "fixed" by using a bigger PermGen
space (once again I stress that this was a *bug* and that
the default PermGen settings were supposed to be plenty,
but because of that hibernate + Sun VM bug it wasn't).

Interesting; I'm reading a bit about it now. Another solution that
seems to be suggested is switching VMs; maybe JRockit or something.
That is, assuming that's the issue in the first place.


Simply forcing the use of a bigger PermGen space fixed
the problem.  Uptime of Tomcat instances (on several
machines) is now in months.

Of course we're unnecessarily lost some memory due to
a weird "Hibernate + Sun VM" bug, but memory is cheap :)

Don't know if you've got the exact same problem, hope
it helps,

Well, I've cranked it up to 512MB, we'll see if it's still running in
a few weeks (a crystal ball would greatly increase my productivity
here). Once I figure out how, I'll also periodically log / check free
permgen space to see if I can spot a leak.


Thanks again,
Jason
.



Relevant Pages

  • Re: Web app + Tomcat + MS SQL Server + Desktop Applications = Mysterious db write locks every few we
    ... Hibernate and the Sun VM. ... The behavior was as you describe: restarting Tomcat would fix the ... Hibernate + Sun VM bug (Google is ...
    (comp.lang.java.programmer)
  • Re: Web app + Tomcat + MS SQL Server + Desktop Applications = Mysterious db write locks every few we
    ... Hibernate and the Sun VM. ... The behavior was as you describe: restarting Tomcat would fix the ... pointing fingers at cglib and suggest using normal reflection instead ...
    (comp.lang.java.programmer)
  • Re: Hibernate not finding Oracle driver - despite straight JDBC working
    ... Here is my config, which is in my classpath. ... I have made sure I have DBCP, my Oracle driver etc in the tomcat global ... > running Hibernate with Oracle and have had no problems. ...
    (comp.lang.java.databases)
  • Re: (Spring/Tapestry)-POJOs-hibernate-oracle-JBOSS
    ... Tomcat is a web container. ... > what is the advantage of O/R mapping provided by hibernate what are all ... _J2EE Development without EJB_. ...
    (comp.lang.java.help)
  • Re: Hibernation woes
    ... When it comes up the ubuntu splash screen progress bar freezes and disk activity is constant because it's reading and starting all the app's from the file in swap. ... When it did work it complained about 2 things, and now it fails and brings up a flat rectangular grey box asking for my password after which it resumes from where it left off. ... I tried looking at the bash or bash like files that control "hibernate" but I could not figure it out. ... In my opinion the hibernation function has not been comprehensively tested or the "bug" would not occur -- and it is certainly a bug! ...
    (Ubuntu)