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


  url
  jdbc:mysql://localhost:3306/javatest?autoReconnect=true


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

Regards,
Paul Phillips

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




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...)
> 
>  debug="5" reloadable="true" crossContext="true">
> 
> prefix="localhost_DBTest_log." suffix=".txt"
>  timestamp="true"/>
> 
>   auth="Container"
>type="javax.sql.DataSource"/>
> 
>   
> 
>   factory
>   org.apache.commons.dbcp.BasicDataSourceFactory
> 
> 
>   maxActive
>   100
> 
> 
>   maxIdle
>   3
> 
> 
>   maxWait
>   100
> 
> 
>  username
>  javauser
> 
> 
>  password
>  javadude
> 
> 
> 
>driverClassName
>org.gjt.mm.mysql.Driver
> 
> 
> 
>   url
>   jdbc:mysql://localhost:3306/javatest
> 
>   
> 
> 
> 
> --
> 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:
>>
>>  
>>autoReconnect
>>true
>> 
>>
> 
> I know that the above does not work...  I tried it.
> 
>> or
>>
>> 
>>   url
>>
>> jdbc:mysql://localhost:3306/javatest?autoReconnect=true
>> 
>>
> 
> 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:   
For additional commands, e-mail: 




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:
>
>  
>autoReconnect
>true
> 
>

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

> or
>
> 
>   url
>
> jdbc:mysql://localhost:3306/javatest?autoReconnect=true
> 
>

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...)
>
>  debug="5" reloadable="true" crossContext="true">
>
> prefix="localhost_DBTest_log." suffix=".txt"
>  timestamp="true"/>
>
>   auth="Container"
>type="javax.sql.DataSource"/>
>
>   
> 
>   factory
>   org.apache.commons.dbcp.BasicDataSourceFactory
> 
> 
>   maxActive
>   100
> 
> 
>   maxIdle
>   3
> 
> 
>   maxWait
>   100
> 
> 
>  username
>  javauser
> 
> 
>  password
>  javadude
> 
>
> 
>driverClassName
>org.gjt.mm.mysql.Driver
> 
>
> 
>   url
>   jdbc:mysql://localhost:3306/javatest
> 
>   
> 
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
> --
> To unsubscribe, e-mail:
>  For additional
> commands, e-mail: 



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: sweeping stale connections - Commons DBCP and Tomcat 4.1.9

2002-08-26 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:

 
   autoReconnect
   true


or


  url
  jdbc:mysql://localhost:3306/javatest?autoReconnect=true


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



  

  

  

  factory
  org.apache.commons.dbcp.BasicDataSourceFactory


  maxActive
  100


  maxIdle
  3


  maxWait
  100


 username
 javauser


 password
 javadude



   driverClassName
   org.gjt.mm.mysql.Driver



  url
  jdbc:mysql://localhost:3306/javatest

  



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



  

  

  

  factory
  org.apache.commons.dbcp.BasicDataSourceFactory


  maxActive
  100


  maxIdle
  3


  maxWait
  100


 username
 javauser


 password
 javadude



   driverClassName
   org.gjt.mm.mysql.Driver



  url
  jdbc:mysql://localhost:3306/javatest

  



--
To unsubscribe, e-mail:   
For additional commands, e-mail: