tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giorgio Ponza" <gior...@opla.it>
Subject Re: Tomcat STILL freezing - time to look at another app server?
Date Fri, 30 May 2003 09:07:59 GMT
I would try not to use the line
Statement addressStatement =
conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDA
TABLE);
but only
Statement addressStatement = conn.createStatement();
In fact, you don't get a ResultSet from the statement!
Second:
I would use a prepared statement, so i can control parameter types better.
Are u sure the sql is correct? have u printed it? maybe there are some '
broken

Try also to substitute the sequence value with a predefined number.
There are also some optimizations creating the query, like using
StringBuffer instead of concatenating strings....
Let us know!!!

Giorgio Ponza




----- Original Message -----
From: "Ralph Einfeldt" <ralph.einfeldt@uptime-isc.de>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Friday, May 30, 2003 10:42 AM
Subject: RE: Tomcat STILL freezing - time to look at another app server?


There are many possible reasons why tomcat may freeze:

- Database
  - ConnectionPool exhausted
    Do you use a connection pool ?
    - Which one ? How is it configured ?
    - Most connection pools let you configure the behaviour
      if the the pool is exhausted. To identify the problem
      you should temporarly set the timout for waiting for a
      connection to 0.
  - Database dead lock.
    Which database do you use ?
    Which driver do you use ?
    Do you use transaction or autocommit ?
    - Some databases have means to show the currently
      open statements.
    - Some databases can be configured to identify deadlocks
      and return an error instead.
    - If your database can't help you to identfy the problem,
      you may need to log every sql statement and the termination
      of the statement to see which statements are active when
      tomcat freezes.
    - Can you access pages without db access if tomcat freezes ?
      If not it's unlikely that you have a database dead lock.

- Garbage Collection
  - enable verboseGC to see if the garbage collection happens
    when tomcat freezes. If so, try to use other modes for the
    garbage collector, that work concurrently.

- Memory Usage
  - Look for the memory usage of your system
    - How much Memory is used ?
    - How much Swap is used ?
    - How much is paged ?

- Thread dead lock

If you can't safely reproduce the error, you may need to log
some of the above information frequently (best with every
request) to see if some values get critical when the freeze
happens.

>>From your current post, I would expect a DB dead lock.

> -----Original Message-----
> From: Hunter, Sandra [mailto:Sandra_Hunter@BCTransit.Com]
> Sent: Friday, May 30, 2003 1:25 AM
> To: 'Tomcat Users List'
> Subject: RE: Tomcat STILL freezing - time to look at another
> app server?
>
>
> Okay so just for my own interest (and sanity): here is the place where
> things are freezing.
> Can anyone see anything wrong with this?
>
> System.out.println ("ADDRESS");
>
> /* add data to the ADDRESS table */
> String addressSQL = "INSERT INTO address (str_address_id,
> str_mailing, " +
> "str_street, str_city, str_province, str_postal_code) " +
> "VALUES " +
> "(address_seq.currval, '" + parentMailing + "', '" +
> parentStreet + "', " +
> "'" + parentCity + "','" + parentProvince + "','" +
> parentPostalCode + "')";
>
> Statement addressStatement =
> conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
> ResultSet.CONCUR_UPDATABLE);
>
> /* execute the statement */
> System.out.println ("Address " + addressSQL); //freezing
> here!! Not every
> time but always this place
> //ResultSet addressResults =
> addressStatement.executeQuery(addressSQL);
>
> boolean addressResults =
> addressStatement.execute(addressSQL);//still
> freezes with this one as well
>
> //addressResults.close();
> addressStatement.close();
>
> I have several similar lines that all run in sequence, adding data to
> different tables.
> The SQL has been tested in SQL+ and it all works.
> This doesn't always freeze.
> I have beans that I set back to null, and session variables
> that I do the
> same with, at the end of this particular file and at the
> beginning of the
> app.
>
> -----Original Message-----
> From: Hunter, Sandra [mailto:Sandra_Hunter@BCTransit.Com]
> Sent: Thursday, May 29, 2003 11:40 AM
> To: 'Tomcat Users List'
> Subject: RE: Tomcat STILL freezing - time to look at another
> app server?
>
> Thanks All! It helps to hear that others have occasionally
> had this problem.
> I will look into all your suggestions and see if resolution
> can be found.
> Sandra
>
> -----Original Message-----
> From: Koes, Derrick [mailto:Derrick.Koes@smith-nephew.com]
> Sent: Wednesday, May 28, 2003 12:44 PM
> To: 'Tomcat Users List'
> Subject: RE: Tomcat STILL freezing - time to look at another
> app server?
>
>
> I don't know if this helps any, but this has benefited me.
>
> If using an oracle database, try
> oracle.jdbc.pool.OracleOCIConnectionPool to
> get connection pool stats.
>
>
>
> -----Original Message-----
> From: Carl [mailto:carl@etrak-plus.com]
> Sent: Wednesday, May 28, 2003 2:48 PM
> To: Tomcat Users List
> Subject: Re: Tomcat STILL freezing - time to look at another
> app server?
>
> I have had a problem that sounds very similar many times (I
> don't learn very
> fast.)  In all my cases, the problem was running the
> connection pool out of
> connections because I wasn't freeing the connections in c
> couple of places.
> The fact that it occurs when trying to insert something into
> the data base
> indicates that it is related to that activity.
>
> ----- Original Message -----
> From: "Hunter, Sandra" <Sandra_Hunter@BCTransit.Com>
> To: "'Tomcat Users List'" <tomcat-user@jakarta.apache.org>
> Sent: Wednesday, May 28, 2003 1:48 PM
> Subject: RE: Tomcat STILL freezing - time to look at another
> app server?
>
>
> > I am not able to reproduce the problem reliably: that's
> what is making me
> > crazy.
> > It happens when things are being inserted to the database
> but never on the
> > same page, never everytime, doesn't matter what else I am
> doing or what
> else
> > has been done. No one else is accessing this database right
> now so I am
> the
> > only one and I have tested and retested all the sql.
> > I am stumped.
> > Hopefully running on the server will improve the situation.
> > You know, though, I am demoing the app for my client this
> afternoon so
> maybe
> > it is just a smelling fear thing.
> > Thanks for the feedback you guys.
> >
> > -----Original Message-----
> > From: Shapira, Yoav [mailto:Yoav.Shapira@mpi.com]
> > Sent: Wednesday, May 28, 2003 8:35 AM
> > To: Tomcat Users List
> > Subject: RE: Tomcat STILL freezing - time to look at
> another app server?
> >
> >
> > Howdy,
> > That's unfortunate ;(  I've had tough issues that appeared
> to be random
> > (like your network traffic hypothesis) and were very
> difficult to debug
> > ;(
> >
> > I've tried many many containers / app servers, and always
> come back to
> > tomcat.  This was even before I started contributing to tomcat's
> > codebase, and is more true now than ever.
> >
> > So you are never able to reproduce the problem reliably?
> >
> > Yoav Shapira
> > Millennium ChemInformatics
> >
> >
> > >-----Original Message-----
> > >From: Hunter, Sandra [mailto:Sandra_Hunter@BCTransit.Com]
> > >Sent: Wednesday, May 28, 2003 11:26 AM
> > >To: 'Tomcat Users List'
> > >Subject: Tomcat STILL freezing - time to look at another
> app server?
> > >
> > >Well this issue continues. Code has been commented, logged, oracle
> > >permissions all tickety boo, no locks.
> > >
> > >It really is intermittent, and in my opinion seems to be somewhat
> > related
> > >to
> > >network traffic. I talked to one of the tech guys and he seemed to
> > think I
> > >was nuts.
> > >
> > >It never happens at night or on the weekends when I am
> pretty much the
> > only
> > >one on the network.
> > >
> > >Does that sound possible to any one with more experience than I?
> > >
> > >Although we moved it to the live server we had some
> install problems
> > there
> > >and so I am still running off my dev machine. It is just a
> regular P4
> > with
> > >about 1600mhz and 256 ram. Do you think the freezing will
> cease when
> > >running
> > >off the server?
> > >
> > >And on the other subject: have any of you tried other app
> servers out
> > >there?
> > >Do you have any opinions? Tomcat seems to be the industry
> standard but
> > if I
> > >can't resolve this freezing issue I might get some
> pressure to try some
> > >different technology.
> > >
> > >-----Original Message-----
> > >From: Hunter, Sandra [mailto:Sandra_Hunter@BCTransit.Com]
> > >Sent: Friday, May 16, 2003 2:52 PM
> > >To: 'Tomcat Users List'
> > >Subject: RE: Tomcat Freezing?
> > >
> > >The lock may be an issue: I'll run that past our DBA but that's the
> > only
> > >thing I haven't looked at.
> > >We have actually moved the app to another machine to see
> if that makes
> > any
> > >difference.
> > >If anyone gets a bright idea I would love to hear it!
> > >Puzzled Sandra
> > >
> > >-----Original Message-----
> > >From: Jason Bainbridge [mailto:jason@jblinux.org]
> > >Sent: Friday, May 16, 2003 12:11 PM
> > >To: Tomcat Users List
> > >Subject: Re: Tomcat Freezing?
> > >
> > >I'm running out of ideas myself... I gather this is quite a  beefy
> > machine
> > >you're running it on?
> > >
> > >Are you using the right version of the Oracle Thin Driver for the
> > version
> > >of
> > >
> > >Oracle you are running? Have you got a DBA on site or are
> you able to
> > look
> > >at
> > >the appropriate v$ view to see what query it died on and
> possibly why?
> > >
> > >It's not something like not releasing a lock on a record
> or commits not
> > >being
> > >on or something silly like that in the Oracle config?
> > >
> > >Jason
> > >
> > >On Sat, 17 May 2003 02:29 am, Hunter, Sandra wrote:
> > >> I spoke too soon. I am really stumped now.
> > >> Code that ran yesterday, won't run today. I have gone
> through it line
> > by
> > >> line, commenting it all out, and then gradually adding
> in each line,
> > and
> > >> then it runs again. Same code. No changes.
> > >> If I restart Tomcat the code will run. Sometimes. Other
> times not.
> > >> I have looked at the Tomcat logs and I don't see
> anything that tells
> > me
> > >> anything.
> > >> There must be some common event that is causing this but
> I can't seem
> > to
> > >> place it or find it.
> > >> It almost seems like the code needs a warm up run before it can
> > really
> > >get
> > >> going. How weird is that?
> > >> Any idea what I should be looking for?
> > >> Besides a psychiatrist?
> > >> Sandra
> > >>
> > >> -----Original Message-----
> > >> From: Hunter, Sandra [mailto:Sandra_Hunter@BCTransit.Com]
> > >> Sent: Thursday, May 15, 2003 3:29 PM
> > >> To: 'Tomcat Users List'
> > >> Subject: RE: Tomcat Freezing?
> > >>
> > >> Well it has stopped. I think I did have a code error: I
> was calling
> > the
> > >> wrong statement for a resultset, so calling it twice. I have made
> > such an
> > >> error before without causing such a crisis but I guess Tomcat had
> > just
> > >had
> > >> enough of my foolishness.
> > >> It is so frustrating to not know why something is happening and I
> > thought
> > >I
> > >> had done everything right but after doing it twice it
> got sorted out.
> > >> Thanks all!
> > >> Sandra
> > >>
> > >> -----Original Message-----
> > >> From: Jason Bainbridge [mailto:jason@jblinux.org]
> > >> Sent: Thursday, May 15, 2003 2:41 PM
> > >> To: Tomcat Users List
> > >> Subject: Re: Tomcat Freezing?
> > >>
> > >> I assume you are using the Oracle JDBC Thin drivers
> then? Just want
> > to
> > >make
> > >> sure you aren't doing anything like using the JDBC-ODBC
> bridge but I
> > >doubt
> > >> it
> > >> just clutching at straws...
> > >>
> > >> Do the log files shine any info on the problem? (not your log
> > messages
> > >but
> > >> the
> > >> Tomcat logs)?
> > >>
> > >> J.
> > >>
> > >> On Fri, 16 May 2003 05:28 am, Hunter, Sandra wrote:
> > >> > The queries all run in Oracle.
> > >> > Other pages with SQL queries all run fine.
> > >> > The privileges all allow for the SQL stuff I am doing
> which is very
> > >> > basic. I am going through the commenting process again
> and lines
> > that
> > >ran
> > >> > fine half an hour ago with no changes made now seem to
> be stalling.
> > >> > Even when I close the app, Tomcat is still hung and I
> can't close
> > it
> > >from
> > >> > the command line.
> > >> > I close all my resultsets and statements and connections.
> > >> > I could include all my code but there are thousands of
> lines and
> > there
> > >> > seems to be no consistent line or lines that are causing the
> > problem.
> > >> >
> > >> > -----Original Message-----
> > >> > From: George Sexton [mailto:gsexton@mhsoftware.com]
> > >> > Sent: Thursday, May 15, 2003 2:10 PM
> > >> > To: Tomcat Users List
> > >> > Subject: RE: Tomcat Freezing?
> > >> >
> > >> > Have you looked at your database and made sure that
> you don't have
> > >>
> > >> blocking
> > >>
> > >> > issues keeping your queries from running?
> > >> >
> > >> > -----Original Message-----
> > >> > From: Hunter, Sandra [mailto:Sandra_Hunter@BCTransit.Com]
> > >> > Sent: Thursday, May 15, 2003 3:06 PM
> > >> > To: 'Tomcat Users List'
> > >> > Subject: RE: Tomcat Freezing?
> > >> >
> > >> >
> > >> > This freezing problem seems to be really intermittent.
> I am really
> > >>
> > >> stumped.
> > >>
> > >> > I have put in printlines every other line and
> commented out just
> > about
> > >> > everything and then gradually added stuff and it will freeze at
> > pretty
> > >> > (apparently) random places. It stopped doing it with
> one page (for
> > no
> > >> > apparent reason) and now has started doing it with
> another. But it
> > >> > doesn't happen consistently.
> > >> > No applets, etc. Nothing fancy at all just straight
> ahead java and
> > sql.
> > >> > I surely am confused.
> > >> >
> > >> > -----Original Message-----
> > >> > From: Bill Barker [mailto:wbarker@wilshire.com]
> > >> > Sent: Wednesday, May 14, 2003 10:40 PM
> > >> > To: tomcat-user@jakarta.apache.org
> > >> > Subject: Re: Tomcat Freezing?
> > >> >
> > >> > I second Matt's suggestions.  If you are really
> stumped as to the
> > >> > problem, try inserting logging statements every few
> lines in your
> > JSP
> > >(if
> > >> > you are not using a real logging package, such as
> log4j, Tomcat's
> > >default
> > >> > JSPPage class extends GenericServlet, so you can simply do
> > something
> > >like
> > >> > <% log("Getting DB info"); %>).
> > >> >
> > >> > "Matt Wiseley" <matt@wiseley.com> wrote in message
> > >> > news:E19G5gS-0007S9-7C@odie.runbox.com...
> > >> > Sandra,
> > >> >
> > >> > If it's only happening with one JSP, and it happens
> every time it's
> > >> > requested, it's almost certainly a coding problem.
> Without looking
> > at
> > >the
> > >> > source code, it's pretty hard to say what's causing
> it. From my own
> > >> > experience, I have seen only two coding errors that
> "hang" Tomcat.
> > The
> > >> > first is opening database connections from a pool and
> not closing
> > them.
> > >>
> > >> The
> > >>
> > >> > second is a page that forwards to itself somehow. Also look for
> > code
> > >that
> > >> > creates an endless loop of some kind, although these
> usually either
> > run
> > >>
> > >> out
> > >>
> > >> > of memory, cause an overflow, or time out.
> > >> >
> > >> > Matt
> > >> >
> > >> > > Being new and inexperienced as I am I don't know how
> to problem
> > solve
> > >> > > this issue.
> > >> > >
> > >> > > I have a jsp app that I am running in Tomcat 4.0
> with Apache 2
> > HTTP
> > >> >
> > >> > server
> > >> >
> > >> > > on a Win2k pro box.
> > >> > >
> > >> > > My apologies to those who receive this twice. Some
> weirdness with
> > my
> > >> >
> > >> > address
> > >> >
> > >> > > book.
> > >> > >
> > >> > > All has been well until now. I have one page that is
> freezing: it
> > >>
> > >> doesn't
> > >>
> > >> > > complete loading after several minutes. When I try
> to shut down
> > >Tomcat
> > >>
> > >> it
> > >>
> > >> > > also doesn't do anything. It displays this message
> in the command
> > >line:
> > >> > > "Stopping service Tomcat-Standalone" but after
> several minutes
> > the
> > >>
> > >> window
> > >>
> > >> > is
> > >> >
> > >> > > still open and the task manager tells me Tomcat is
> still running.
> > I
> > >> > > have tried stopping tomcat,deleting all the files in the work
> > folder
> > >> > > and restarting Tomcat.
> > >> > >
> > >> > > I know it must be something to do with the page, but
> I don't know
> > >where
> > >> > > to begin to look or what to look for.
> > >> > >
> > >> > > Any ideas?
> > >> > >
> > >> > >
> > >> > >
> > >> > > Sandra Patricia Hunter
> > >> > >
> > >> > >
> > >> > >
> >
> ---------------------------------------------------------------------
> > >> > > To unsubscribe, e-mail:
> > tomcat-user-unsubscribe@jakarta.apache.org
> > >> > > For additional commands, e-mail:
> > tomcat-user-help@jakarta.apache.org
> > >> >
> > >> >
> >
> ---------------------------------------------------------------------
> > >> > To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> > >> > For additional commands, e-mail:
> > tomcat-user-help@jakarta.apache.org
> > >> >
> > >> >
> >
> ---------------------------------------------------------------------
> > >> > To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> > >> > For additional commands, e-mail:
> > tomcat-user-help@jakarta.apache.org
> > >> >
> > >> >
> > >> >
> >
> ---------------------------------------------------------------------
> > >> > To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> > >> > For additional commands, e-mail:
> > tomcat-user-help@jakarta.apache.org
> > >> >
> > >> >
> >
> ---------------------------------------------------------------------
> > >> > To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> > >> > For additional commands, e-mail:
> > tomcat-user-help@jakarta.apache.org
> > >
> > >--
> > >Jason Bainbridge
> > >KDE Web Team - http://kde.org
> > >webmaster@kde.org
> > >
> >
> >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> > >
> >
> >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> > >
> >
> >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> >
> >
> >
> >
> > This e-mail, including any attachments, is a confidential business
> > communication, and may contain information that is confidential,
> proprietary
> > and/or privileged.  This e-mail is intended only for the
> individual(s) to
> > whom it is addressed, and may not be saved, copied,
> printed, disclosed or
> > used by anyone else.  If you are not the(an) intended
> recipient, please
> > immediately delete this e-mail from your computer system
> and notify the
> > sender.  Thank you.
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> This electronic transmission is strictly confidential to
> Smith & Nephew and
> intended solely for the addressee.  It may contain
> information which is
> covered by legal, professional or other privilege.  If you are not the
> intended addressee, or someone authorized by the intended addressee to
> receive transmissions on behalf of the addressee, you must not retain,
> disclose in any form, copy or take any action in reliance on this
> transmission.  If you have received this transmission in error, please
> notify the sender as soon as possible and destroy this message.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message