You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marcelo Epstein <ma...@epstein.com.br> on 2004/04/06 18:08:49 UTC

Connection Pooling

Hi,

I have just started using Connection Pooling in my app  (Tomcat, Struts, DBCP, Mysql) .
It woks for about 20 hours and stop working until tomcat restart. 

I get this exception:

org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted, cause:
java.util.NoSuchElementException: Timeout waiting for idle object

I can´t fix it. Any advice??

Thanks in advance.
Marcelo



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


Re: Connection Pooling

Posted by Mark Lowe <ma...@boxstuff.com>.
I had the same.. I ditched version 2 and haven't had any problems since.


On 6 Apr 2004, at 18:34, Marcelo Epstein wrote:

> Mark,
>
> I am using Mysql Driver version 3. What´s the problem of this "stable" 
> driver. ??
> I will give a try version 2. But I really cant understand why..
>
> Thanks...
>
>
>
>
> On Tue, 6 Apr 2004 18:20:29 +0200, Mark Lowe <ma...@boxstuff.com> 
> escreveu:
>
>> De: Mark Lowe <ma...@boxstuff.com>
>> Data: Tue, 6 Apr 2004 18:20:29 +0200
>> Para: "Struts Users Mailing List" <us...@struts.apache.org>
>> Assunto: Re: Connection Pooling
>>
>> If your using the version 3 mysql driver don't.. Use version 2 and
>> never look back.
>>
>> There also a ?autoReconnect=true parameter to pass through with the
>> url, but i think thats bollocks or at least didn't work with version3
>> mysql drivers.
>>
>> On 6 Apr 2004, at 18:08, Marcelo Epstein wrote:
>>
>>> Hi,
>>>
>>> I have just started using Connection Pooling in my app  (Tomcat,
>>> Struts, DBCP, Mysql) .
>>> It woks for about 20 hours and stop working until tomcat restart.
>>>
>>> I get this exception:
>>>
>>> org.apache.commons.dbcp.SQLNestedException: Cannot get a connection,
>>> pool exhausted, cause:
>>> java.util.NoSuchElementException: Timeout waiting for idle object
>>>
>>> I can´t fix it. Any advice??
>>>
>>> Thanks in advance.
>>> Marcelo
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


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


Re: Connection Pooling

Posted by Marcelo Epstein <ma...@epstein.com.br>.
Mark, 

I am using Mysql Driver version 3. What´s the problem of this "stable" driver. ?? 
I will give a try version 2. But I really cant understand why..

Thanks...

 


On Tue, 6 Apr 2004 18:20:29 +0200, Mark Lowe <ma...@boxstuff.com> escreveu:

> De: Mark Lowe <ma...@boxstuff.com>
> Data: Tue, 6 Apr 2004 18:20:29 +0200
> Para: "Struts Users Mailing List" <us...@struts.apache.org>
> Assunto: Re: Connection Pooling
> 
> If your using the version 3 mysql driver don't.. Use version 2 and 
> never look back.
> 
> There also a ?autoReconnect=true parameter to pass through with the 
> url, but i think thats bollocks or at least didn't work with version3 
> mysql drivers.
> 
> On 6 Apr 2004, at 18:08, Marcelo Epstein wrote:
> 
> > Hi,
> >
> > I have just started using Connection Pooling in my app  (Tomcat, 
> > Struts, DBCP, Mysql) .
> > It woks for about 20 hours and stop working until tomcat restart.
> >
> > I get this exception:
> >
> > org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, 
> > pool exhausted, cause:
> > java.util.NoSuchElementException: Timeout waiting for idle object
> >
> > I can´t fix it. Any advice??
> >
> > Thanks in advance.
> > Marcelo
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> 

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


Re: Connection Pooling

Posted by Mark Lowe <ma...@boxstuff.com>.
If your using the version 3 mysql driver don't.. Use version 2 and 
never look back.

There also a ?autoReconnect=true parameter to pass through with the 
url, but i think thats bollocks or at least didn't work with version3 
mysql drivers.

On 6 Apr 2004, at 18:08, Marcelo Epstein wrote:

> Hi,
>
> I have just started using Connection Pooling in my app  (Tomcat, 
> Struts, DBCP, Mysql) .
> It woks for about 20 hours and stop working until tomcat restart.
>
> I get this exception:
>
> org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, 
> pool exhausted, cause:
> java.util.NoSuchElementException: Timeout waiting for idle object
>
> I can´t fix it. Any advice??
>
> Thanks in advance.
> Marcelo
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


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


Re: Connection Pooling

Posted by Geeta Ramani <ge...@cmpco.com>.
Marcelo;

You are probably exhausting all your connections in the pool.  Make sure all your connections
are returned back to the pool at the end of a "finally" block. That way the connection is
returned to the pool regardless of whether your database work was a success or not. Also, while
you are developing, keep the number of connections in the pool restricted to 1. That way you
can easily verify that you are always returning connections back..

A while back a long discussion was held here relating to just this issue.. you may want to
search the archives.. (let me know if you cant find the discussion..)

Regards,
Geeta

Marcelo Epstein wrote:

> Hi,
>
> I have just started using Connection Pooling in my app  (Tomcat, Struts, DBCP, Mysql) .
> It woks for about 20 hours and stop working until tomcat restart.
>
> I get this exception:
>
> org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted, cause:
> java.util.NoSuchElementException: Timeout waiting for idle object
>
> I can´t fix it. Any advice??
>
> Thanks in advance.
> Marcelo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org


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