Re: sweeping stale connections - Commons DBCP and Tomcat 4.1.9

2002-08-28 Thread Paul Phillips

Hello -


 I had this same problem, appending ?autoReconnect=true to your connect
 URL does work.


I tried this --

parameter
  nameurl/name
  valuejdbc:mysql://localhost:3306/javatest?autoReconnect=true/value
/parameter

in my server.xml and it DOES work.  Thanks to Glenn and Jay who suggested 
it.

Regards,
Paul Phillips

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: sweeping stale connections - Commons DBCP and Tomcat 4.1.9

2002-08-27 Thread Jay Gardner

Hi Paul,

I don't have experience with this pool, but I have experienced this
disconnection problem with mysql. Got around it using the mysql parameter
autoReconnect=true. I would suggest trying either of the following:

 parameter
   nameautoReconnect/name
   valuetrue/value
/parameter

or

parameter
  nameurl/name
  valuejdbc:mysql://localhost:3306/javatest?autoReconnect=true/value
/parameter

If one is successful, please report back so that we know if it worked for
you or not.


Regards,

--Jay Gardner

-Original Message-
From: Paul Phillips [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 26, 2002 10:04 PM
To: Tomcat Users List
Subject: sweeping stale connections - Commons DBCP and Tomcat 4.1.9

I'm using Tomcat 4.1.9.  I have been having a problem with the DBCP jdbc
connection pool when used with MySQL.  Apparently MySQL kills off stale
connections after an 8 hour period.  According to Mark Matthews (developer
of the jdbc-mysql driver), I need to configure the pool to sweep out the
stale connections, and initiate new ones.

I have looked and looked in vain for documentation for DBCP that would
explain how to set the configuration in my Tomcat server.xml file (using
JNDI) that would enable this.  I can't find anything.  I've tried examining
the source of DBCP, but I'm afraid that I can't figure it out.

My Tomcat server.xml file uses this configuration below, which is right out
of:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-ho
wto.html

From what I can tell, there are other parameters that  I can enter to force
the sweeping of stale connections.  However, I don't know what they are, or
how to use them.  If anyone can give me an example of the correct syntax
here, I would be very grateful, ( since my webapp dies every night, due to
this problem!)

Thanks --

Paul Phillips

(excerpt of server.xml...)

Context path=/DBTest docBase=DBTest
debug=5 reloadable=true crossContext=true

  Logger className=org.apache.catalina.logger.FileLogger
 prefix=localhost_DBTest_log. suffix=.txt
 timestamp=true/

  Resource name=jdbc/TestDB
   auth=Container
   type=javax.sql.DataSource/

  ResourceParams name=jdbc/TestDB
parameter
  namefactory/name
  valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
/parameter
parameter
  namemaxActive/name
  value100/value
/parameter
parameter
  namemaxIdle/name
  value3/value
/parameter
parameter
  namemaxWait/name
  value100/value
/parameter
parameter
 nameusername/name
 valuejavauser/value
/parameter
parameter
 namepassword/name
 valuejavadude/value
/parameter

parameter
   namedriverClassName/name
   valueorg.gjt.mm.mysql.Driver/value
/parameter

parameter
  nameurl/name
  valuejdbc:mysql://localhost:3306/javatest/value
/parameter
  /ResourceParams
/Context


--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: sweeping stale connections - Commons DBCP and Tomcat 4.1.9

2002-08-27 Thread Paul Phillips

Hello

 I would suggest trying either of the following:

  parameter
nameautoReconnect/name
valuetrue/value
 /parameter


I know that the above does not work...  I tried it.

 or

 parameter
   nameurl/name

 valuejdbc:mysql://localhost:3306/javatest?autoReconnect=true/value
 /parameter


I didn't try this, because I think that the ? in the url is already being 
provided by the code somewhere, so to add it here would duplicate it.

From what I could tell by reading the code, there is some way to trigger an 
expire mechanism at regular intervals - I just don't know how to set that 
up...

Thanks,
Paul Phillips




my original message is below...



 I'm using Tomcat 4.1.9.  I have been having a problem with the DBCP jdbc
 connection pool when used with MySQL.  Apparently MySQL kills off stale
 connections after an 8 hour period.  According to Mark Matthews (developer
 of the jdbc-mysql driver), I need to configure the pool to sweep out the
 stale connections, and initiate new ones.

 I have looked and looked in vain for documentation for DBCP that would
 explain how to set the configuration in my Tomcat server.xml file (using
 JNDI) that would enable this.  I can't find anything.  I've tried
 examining the source of DBCP, but I'm afraid that I can't figure it out.

 My Tomcat server.xml file uses this configuration below, which is right
 out of:
 http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-
 ho wto.html

 From what I can tell, there are other parameters that  I can enter to
 force
 the sweeping of stale connections.  However, I don't know what they are,
 or how to use them.  If anyone can give me an example of the correct
 syntax here, I would be very grateful, ( since my webapp dies every
 night, due to this problem!)

 Thanks --

 Paul Phillips

 (excerpt of server.xml...)

 Context path=/DBTest docBase=DBTest
 debug=5 reloadable=true crossContext=true

   Logger className=org.apache.catalina.logger.FileLogger
  prefix=localhost_DBTest_log. suffix=.txt
  timestamp=true/

   Resource name=jdbc/TestDB
auth=Container
type=javax.sql.DataSource/

   ResourceParams name=jdbc/TestDB
 parameter
   namefactory/name
   valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
 /parameter
 parameter
   namemaxActive/name
   value100/value
 /parameter
 parameter
   namemaxIdle/name
   value3/value
 /parameter
 parameter
   namemaxWait/name
   value100/value
 /parameter
 parameter
  nameusername/name
  valuejavauser/value
 /parameter
 parameter
  namepassword/name
  valuejavadude/value
 /parameter

 parameter
namedriverClassName/name
valueorg.gjt.mm.mysql.Driver/value
 /parameter

 parameter
   nameurl/name
   valuejdbc:mysql://localhost:3306/javatest/value
 /parameter
   /ResourceParams
 /Context


 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]


 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED] For additional
 commands, e-mail: mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: sweeping stale connections - Commons DBCP and Tomcat 4.1.9

2002-08-27 Thread Glenn Nielsen

I had this same problem, appending ?autoReconnect=true to your connect URL does work.

Regards,

Glenn

Paul Phillips wrote:
 Hello
 
 I would suggest trying either of the following:

  parameter
nameautoReconnect/name
valuetrue/value
 /parameter

 
 I know that the above does not work...  I tried it.
 
 or

 parameter
   nameurl/name

 valuejdbc:mysql://localhost:3306/javatest?autoReconnect=true/value
 /parameter

 
 I didn't try this, because I think that the ? in the url is already 
 being provided by the code somewhere, so to add it here would duplicate it.
 
 From what I could tell by reading the code, there is some way to 
 trigger an 
 
 expire mechanism at regular intervals - I just don't know how to set 
 that up...
 
 Thanks,
 Paul Phillips
 


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: sweeping stale connections - Commons DBCP and Tomcat 4.1.9

2002-08-27 Thread Mike Jackson

Switch to poolman, I've never had this with it.  And I've used it
with Informix, Oracle, Postgres, Mysql and DB2.

--mikej
-=-
mike jackson
[EMAIL PROTECTED] 

 -Original Message-
 From: Paul Phillips [mailto:[EMAIL PROTECTED]]
 Sent: Monday, August 26, 2002 9:04 PM
 To: Tomcat Users List
 Subject: sweeping stale connections - Commons DBCP and Tomcat 4.1.9
 
 
 I'm using Tomcat 4.1.9.  I have been having a problem with the DBCP jdbc 
 connection pool when used with MySQL.  Apparently MySQL kills off stale 
 connections after an 8 hour period.  According to Mark Matthews 
 (developer 
 of the jdbc-mysql driver), I need to configure the pool to sweep out the 
 stale connections, and initiate new ones.
 
 I have looked and looked in vain for documentation for DBCP that would 
 explain how to set the configuration in my Tomcat server.xml file (using 
 JNDI) that would enable this.  I can't find anything.  I've tried 
 examining 
 the source of DBCP, but I'm afraid that I can't figure it out.
 
 My Tomcat server.xml file uses this configuration below, which is 
 right out 
 of:
 http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-ex
 amples-ho
 wto.html
 
 From what I can tell, there are other parameters that  I can 
 enter to force 
 the sweeping of stale connections.  However, I don't know what 
 they are, or 
 how to use them.  If anyone can give me an example of the correct syntax 
 here, I would be very grateful, ( since my webapp dies every 
 night, due to 
 this problem!)
 
 Thanks --
 
 Paul Phillips
 
 (excerpt of server.xml...)
 
 Context path=/DBTest docBase=DBTest
 debug=5 reloadable=true crossContext=true
 
   Logger className=org.apache.catalina.logger.FileLogger
  prefix=localhost_DBTest_log. suffix=.txt
  timestamp=true/
 
   Resource name=jdbc/TestDB
auth=Container
type=javax.sql.DataSource/
 
   ResourceParams name=jdbc/TestDB
 parameter
   namefactory/name
   valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
 /parameter
 parameter
   namemaxActive/name
   value100/value
 /parameter
 parameter
   namemaxIdle/name
   value3/value
 /parameter
 parameter
   namemaxWait/name
   value100/value
 /parameter
 parameter
  nameusername/name
  valuejavauser/value
 /parameter
 parameter
  namepassword/name
  valuejavadude/value
 /parameter
 
 parameter
namedriverClassName/name
valueorg.gjt.mm.mysql.Driver/value
 /parameter
 
 parameter
   nameurl/name
   valuejdbc:mysql://localhost:3306/javatest/value
 /parameter
   /ResourceParams
 /Context
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




sweeping stale connections - Commons DBCP and Tomcat 4.1.9

2002-08-26 Thread Paul Phillips

I'm using Tomcat 4.1.9.  I have been having a problem with the DBCP jdbc 
connection pool when used with MySQL.  Apparently MySQL kills off stale 
connections after an 8 hour period.  According to Mark Matthews (developer 
of the jdbc-mysql driver), I need to configure the pool to sweep out the 
stale connections, and initiate new ones.

I have looked and looked in vain for documentation for DBCP that would 
explain how to set the configuration in my Tomcat server.xml file (using 
JNDI) that would enable this.  I can't find anything.  I've tried examining 
the source of DBCP, but I'm afraid that I can't figure it out.

My Tomcat server.xml file uses this configuration below, which is right out 
of:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-ho
wto.html

From what I can tell, there are other parameters that  I can enter to force 
the sweeping of stale connections.  However, I don't know what they are, or 
how to use them.  If anyone can give me an example of the correct syntax 
here, I would be very grateful, ( since my webapp dies every night, due to 
this problem!)

Thanks --

Paul Phillips

(excerpt of server.xml...)

Context path=/DBTest docBase=DBTest
debug=5 reloadable=true crossContext=true

  Logger className=org.apache.catalina.logger.FileLogger
 prefix=localhost_DBTest_log. suffix=.txt
 timestamp=true/

  Resource name=jdbc/TestDB
   auth=Container
   type=javax.sql.DataSource/

  ResourceParams name=jdbc/TestDB
parameter
  namefactory/name
  valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
/parameter
parameter
  namemaxActive/name
  value100/value
/parameter
parameter
  namemaxIdle/name
  value3/value
/parameter
parameter
  namemaxWait/name
  value100/value
/parameter
parameter
 nameusername/name
 valuejavauser/value
/parameter
parameter
 namepassword/name
 valuejavadude/value
/parameter

parameter
   namedriverClassName/name
   valueorg.gjt.mm.mysql.Driver/value
/parameter

parameter
  nameurl/name
  valuejdbc:mysql://localhost:3306/javatest/value
/parameter
  /ResourceParams
/Context


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]