You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Graham Leggett <mi...@sharp.fm> on 2004/02/08 12:31:34 UTC

Tomcat v4.1.27 with database pools unreliable

Hi all,

I have been using tomcat v4.1.27 for a while, hosting some web 
applications without any notable reliability hassles.

Along comes a new application - this app uses the database pool feature 
of tomcat. While this application is deployed, tomcat refuses to stay 
operational for more than an hour or two at a time. After a few hours, 
attempts to connect to tomcat via the HTTP connector hang. Sometimes, 
tomcat unbinds itself from the listening port, causing "connection 
refused" errors to the client - but tomcat itself still stays resident.

Nothing meningful is logged in any logfile.

What are my options? Did the jump from v4.1.27 to v4.1.29 fix anything 
reliability wise? Or should I try and upgrade the server to Tomcat v5 
instead?

Is the tomcat database pool feature something that should be used in 
production?

The database config in the config file looks like this:

   <GlobalNamingResources>
     <Resource name="jdbc/GlobalPatricia" auth="Container"
       type="javax.sql.DataSource"/>
     <ResourceParams name="jdbc/GlobalPatricia">
       <parameter>
         <name>factory</name>
         <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
       </parameter>
       <parameter>
         <name>driverClassName</name>
         <value>org.postgresql.Driver</value>
       </parameter>
       <parameter>
         <name>url</name>
         <value>jdbc:postgresql://127.0.0.1:5432/patricia</value>
       </parameter>
       <parameter>
         <name>username</name>
         <value>yyy</value>
       </parameter>
       <parameter>
         <name>password</name>
         <value>xxx</value>
       </parameter>
       <parameter>
         <name>maxActive</name>
         <value>20</value>
       </parameter>
       <parameter>
         <name>maxIdle</name>
         <value>10</value>
       </parameter>
       <parameter>
         <name>maxWait</name>
         <value>-1</value>
       </parameter>
     </ResourceParams>
 

   </GlobalNamingResources>

The web application context xml definition looks like this:

<Context path="/patricia" docBase="patricia" >

   <Valve className="org.apache.catalina.valves.RemoteAddrValve"
     allow="127.0.0.1"/>

   <Logger className="org.apache.catalina.logger.FileLogger"
              prefix="localhost_patricia_log." suffix=".txt"
           timestamp="true"/>

   <ResourceLink name="jdbc/GlobalPatricia" global="jdbc/GlobalPatricia" 
type="javax.sql.DataSource"/>

   <Realm className="org.apache.catalina.realm.DataSourceRealm" debug="0"
     dataSourceName="jdbc/GlobalPatricia"
     userTable="person" userNameCol="uid" userCredCol="user_password"
     userRoleTable="company_person" roleNameCol="serial"/>
 

</Context>

Regards,
Graham
--


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