You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by andres garcia <li...@hotmail.com> on 2002/11/18 22:45:53 UTC

MySQL connection pooling problems!! (please help)

Hi.
I'm new to struts, and i have find it great, until connection poolling. I'm 
using the GenericDataSurce implementation and my aplicattion uses a 
singleton to access de connection. All the code was in a Wrox book 
(Beginning jsp).
I'm having this problem:
I have a action servlet that query the database using a connection of the 
pool. The first times the connection is recicled, but after some requests, 
the pool creates a new connection and the first one is lost. I'm sure that 
the action servlet is closing the connections because i'm logging this (the 
file seems ok: open - close - open -close). With more request to the action 
all the connections are used and i can`t connect any more to the database. 
I'm the only client (the server is my pc)!!. What is going on? What is the 
problem?
Is a bug of the GenericDataSource? (if i should use other pool, please 
recommend me one easy to install)

Other question: The connection pooling must be supported by the driver or is 
independant? (i'm using the mm.mysql driver latest release)

_________________________________________________________________
Charla con tus amigos en línea mediante MSN Messenger: 
http://messenger.microsoft.com/es


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: MySQL connection pooling problems!! (please help)

Posted by Dragan Ljubojevic <un...@ptt.yu>.
On Tuesday 19 November 2002 14:43, matthew yee-king wrote:
> You could try setting the autoReconnect parameter on the mysql url:
>
> jdbc:mysql://mydomain:3306/mydatabase?autoReconnect=true
>
> cheers
>
> matthew

It's working. 
Now I dont have to reload application every morning.
Thank you.

Dragan



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: MySQL connection pooling problems!! (please help)

Posted by matthew yee-king <ye...@no-future.com>.
You could try setting the autoReconnect parameter on the mysql url:

jdbc:mysql://mydomain:3306/mydatabase?autoReconnect=true

cheers

matthew


On Tue, 19 Nov 2002 13:44:34 +0100
Dragan Ljubojevic <un...@ptt.yu> wrote:

> I have same problem and only what I found is this:
> 
> Segment from MySql documentation "A.2.2  MySQL server has gone away
> Error":--------------------------------------------------------------
> -------------- By default, the mysql server closes the connection
> after 8 hours if nothing has happened. 
> You can change the time limit by setting the wait_timeout variable
> when you start mysqld.
> ---------------------------------------------------------------------
> -------
> 
> When I try to connect next time I get "Lost connection to server
> during query" exception.
> 
> Dragan
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>


-- 

Unix is user friendly. It's just very particular about who it's friends
are.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: MySQL connection pooling problems!! (please help)

Posted by Dragan Ljubojevic <un...@ptt.yu>.
I have same problem and only what I found is this:

Segment from MySql documentation "A.2.2  MySQL server has gone away Error":
----------------------------------------------------------------------------
By default, the mysql server closes the connection after 8 hours if 
nothing has happened. 
You can change the time limit by setting the wait_timeout variable when
you start mysqld.
----------------------------------------------------------------------------

When I try to connect next time I get "Lost connection to server during 
query" exception.

Dragan



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: MySQL connection pooling problems!! (please help)

Posted by Míguel Ángel Mulero Martínez <mi...@mad.tecsidel.es>.
I don't know it this would help, but I use the pooling classes of jakarta.
Take a look at:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how
to.html

It's an example under Tomcat.

Regards,
Miguel

> -----Mensaje original-----
> De: andres garcia [mailto:listastruts@hotmail.com]
> Enviado el: lunes, 18 de noviembre de 2002 22:46
> Para: struts-user@jakarta.apache.org
> Asunto: MySQL connection pooling problems!! (please help)
>
>
> Hi.
> I'm new to struts, and i have find it great, until connection
> poolling. I'm
> using the GenericDataSurce implementation and my aplicattion uses a
> singleton to access de connection. All the code was in a Wrox book
> (Beginning jsp).
> I'm having this problem:
> I have a action servlet that query the database using a connection of the
> pool. The first times the connection is recicled, but after some
> requests,
> the pool creates a new connection and the first one is lost. I'm
> sure that
> the action servlet is closing the connections because i'm logging
> this (the
> file seems ok: open - close - open -close). With more request to
> the action
> all the connections are used and i can`t connect any more to the
> database.
> I'm the only client (the server is my pc)!!. What is going on?
> What is the
> problem?
> Is a bug of the GenericDataSource? (if i should use other pool, please
> recommend me one easy to install)
>
> Other question: The connection pooling must be supported by the
> driver or is
> independant? (i'm using the mm.mysql driver latest release)
>
> _________________________________________________________________
> Charla con tus amigos en línea mediante MSN Messenger:
> http://messenger.microsoft.com/es
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>