You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Larry Johnson <lj...@envictus.com> on 2005/03/14 22:39:29 UTC

tomcat freezes when accessing db after several queries

Hi all,

	I've encountered a rather strange error that I need some help
getting to the bottom of. Recently I lost the hard drive on one of my tomcat
application servers. I've since reinstalled and set everything on the
effected machine to mirror the configuration of my other app servers (which
are working fine). However, now when I access the webapp on this server
tomcat seems to freeze (like it's waiting for something) after several
queries to the database are executed. After this happens I am unable to
shutdown tomcat without finding the process number and terminating it using
kill -9 as shutdown.sh fails to halt execution. This seems pretty strange to
me since one, the problem occurs without any errors appearing in
catalina.out or the localhost_log files and two the webapp is able to access
the DB with several queries before it encounters any problems. Does anyone
have any ideas what may be causing this to happen?

Thanks in advance,

Larry 

Here's some info about my runtime environment:

OS: Redhat 9
Tomcat: 5.0.28
JVM: 1.5.02
DB: Oracle 9i

Here's the JDBC connection pool XML I'm using:

<?xml version='1.0' encoding='utf-8'?> 
<Context docBase="/opt/tomcat/webapps/jupiter" path="" cookies="false"
workDir="work/Catalina/localhost/jupiter"> 
  <Resource auth="Container" description="Oracle datasource pool.  See
server.xml file." name="jdbc/EnvictusDB" type="javax.sql.DataSource"/> 
  <ResourceParams name="jdbc/EnvictusDB"> 
    <parameter> 
      <name>factory</name> 
      <value>org.apache.commons.dbcp.BasicDataSourceFactory</value> 
    </parameter> 
    <parameter> 
      <name>password</name> 
      <value>3nv1ctus</value> 
    </parameter> 
    <parameter> 
      <name>url</name> 
      <value>jdbc:oracle:thin:@11.10.10.1:1521:dbname</value> 
    </parameter> 
    <parameter> 
      <name>driverClassName</name> 
      <value>oracle.jdbc.driver.OracleDriver</value> 
    </parameter> 
    <parameter> 
      <name>maxActive</name> 
      <value>0</value> 
    </parameter> 
    <parameter> 
      <name>maxIdle</name> 
      <value>40</value> 
    </parameter> 
    <parameter> 
      <name>maxWait</name> 
      <value>15000</value> 
    </parameter> 
    <parameter> 
      <name>username</name> 
      <value>envictus</value> 
    </parameter> 
    <parameter>  
      <name>removeAbandoned</name>  
      <value>true</value>  
    </parameter>   
    <parameter>  
      <name>removedAbandonedTimeout</name>  
      <value>60</value>  
    </parameter>  
  </ResourceParams> 
</Context>




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


RE: tomcat freezes when accessing db after several queries

Posted by Larry Johnson <lj...@envictus.com>.
I've checked my code and verified that both these measures are implemented
where I query the db. However, I don't think my problem has to do with the
code itself because I'm running versions identical to that of the problem
machine on my other app servers and those are running without a hitch. 

Larry

-----Original Message-----
From: William Stranathan [mailto:shi1wei3@gmail.com] 
Sent: Monday, March 14, 2005 5:35 PM
To: Tomcat Users List
Subject: Re: tomcat freezes when accessing db after several queries

Also, make sure you have a finally block that always closes the
connection so the connection is returned to the pool.

Will Stranathan


On Mon, 14 Mar 2005 15:27:29 -0700, George Sexton
<gs...@mhsoftware.com> wrote:
> Look for something like this:
> 
> Try {
>         statement.execUupdate("some statement");
> } catch (SQLException se){
> }
> 
> Make sure that the catch has:
> 
> conn.rollback();
> 
> > -----Original Message-----
> > From: Larry Johnson [mailto:ljohnson@envictus.com]
> > Subject: tomcat freezes when accessing db after several queries
> >
> > Hi all,
> >
> >       I've encountered a rather strange error that I need some help
> > getting to the bottom of. Recently I lost the hard drive on
> > one of my tomcat
> > application servers. I've since reinstalled and set everything on the
> > effected machine to mirror the configuration of my other app
> > servers (which
> > are working fine). However, now when I access the webapp on
> > this server
> > tomcat seems to freeze (like it's waiting for something) after several
> > queries to the database are executed. After this happens I am

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


Re: tomcat freezes when accessing db after several queries

Posted by William Stranathan <sh...@gmail.com>.
Also, make sure you have a finally block that always closes the
connection so the connection is returned to the pool.

Will Stranathan


On Mon, 14 Mar 2005 15:27:29 -0700, George Sexton
<gs...@mhsoftware.com> wrote:
> Look for something like this:
> 
> Try {
>         statement.execUupdate("some statement");
> } catch (SQLException se){
> }
> 
> Make sure that the catch has:
> 
> conn.rollback();
> 
> > -----Original Message-----
> > From: Larry Johnson [mailto:ljohnson@envictus.com]
> > Subject: tomcat freezes when accessing db after several queries
> >
> > Hi all,
> >
> >       I've encountered a rather strange error that I need some help
> > getting to the bottom of. Recently I lost the hard drive on
> > one of my tomcat
> > application servers. I've since reinstalled and set everything on the
> > effected machine to mirror the configuration of my other app
> > servers (which
> > are working fine). However, now when I access the webapp on
> > this server
> > tomcat seems to freeze (like it's waiting for something) after several
> > queries to the database are executed. After this happens I am

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


RE: tomcat freezes when accessing db after several queries

Posted by George Sexton <gs...@mhsoftware.com>.
Look for something like this:

Try {
	statement.execUupdate("some statement");
} catch (SQLException se){
}


Make sure that the catch has:

conn.rollback();

In JDBC, a failed update leaves the underlying record locked until it is
rolled back.



George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
  

> -----Original Message-----
> From: Larry Johnson [mailto:ljohnson@envictus.com] 
> Sent: Monday, March 14, 2005 2:39 PM
> To: tomcat-user@jakarta.apache.org
> Subject: tomcat freezes when accessing db after several queries
> 
> Hi all,
> 
> 	I've encountered a rather strange error that I need some help
> getting to the bottom of. Recently I lost the hard drive on 
> one of my tomcat
> application servers. I've since reinstalled and set everything on the
> effected machine to mirror the configuration of my other app 
> servers (which
> are working fine). However, now when I access the webapp on 
> this server
> tomcat seems to freeze (like it's waiting for something) after several
> queries to the database are executed. After this happens I am 
> unable to
> shutdown tomcat without finding the process number and 
> terminating it using
> kill -9 as shutdown.sh fails to halt execution. This seems 
> pretty strange to
> me since one, the problem occurs without any errors appearing in
> catalina.out or the localhost_log files and two the webapp is 
> able to access
> the DB with several queries before it encounters any 
> problems. Does anyone
> have any ideas what may be causing this to happen?
> 
> Thanks in advance,
> 
> Larry 
> 
> Here's some info about my runtime environment:
> 
> OS: Redhat 9
> Tomcat: 5.0.28
> JVM: 1.5.02
> DB: Oracle 9i
> 
> Here's the JDBC connection pool XML I'm using:
> 
> <?xml version='1.0' encoding='utf-8'?> 
> <Context docBase="/opt/tomcat/webapps/jupiter" path="" cookies="false"
> workDir="work/Catalina/localhost/jupiter"> 
>   <Resource auth="Container" description="Oracle datasource pool.  See
> server.xml file." name="jdbc/EnvictusDB" 
> type="javax.sql.DataSource"/> 
>   <ResourceParams name="jdbc/EnvictusDB"> 
>     <parameter> 
>       <name>factory</name> 
>       <value>org.apache.commons.dbcp.BasicDataSourceFactory</value> 
>     </parameter> 
>     <parameter> 
>       <name>password</name> 
>       <value>3nv1ctus</value> 
>     </parameter> 
>     <parameter> 
>       <name>url</name> 
>       <value>jdbc:oracle:thin:@11.10.10.1:1521:dbname</value> 
>     </parameter> 
>     <parameter> 
>       <name>driverClassName</name> 
>       <value>oracle.jdbc.driver.OracleDriver</value> 
>     </parameter> 
>     <parameter> 
>       <name>maxActive</name> 
>       <value>0</value> 
>     </parameter> 
>     <parameter> 
>       <name>maxIdle</name> 
>       <value>40</value> 
>     </parameter> 
>     <parameter> 
>       <name>maxWait</name> 
>       <value>15000</value> 
>     </parameter> 
>     <parameter> 
>       <name>username</name> 
>       <value>envictus</value> 
>     </parameter> 
>     <parameter>  
>       <name>removeAbandoned</name>  
>       <value>true</value>  
>     </parameter>   
>     <parameter>  
>       <name>removedAbandonedTimeout</name>  
>       <value>60</value>  
>     </parameter>  
>   </ResourceParams> 
> </Context>
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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