problem with numActive counter

2010-01-15 Thread Daniele Bonetto
Hello everyone! I notice a problem using GenericObjectPool. My code is like this: Object obj = null; try { obj = this.borrowObject(); } catch(NoSuchElementException ex) { log.error(no such element exception, ex);

Re: problem with numActive counter

2010-01-15 Thread Simone Tripodi
Ciao Daniele ;) First, I suggest you to start the subject line with [componentname], i.e. [POOL] if you're referring commons-pool, otherwise people risk to get confused and not able to reply. I don't know the Pool so deeply and maybe I didn't understand the problem, but reading your code I'm

[GenericObjectPool] problem with numActive counter

2010-01-15 Thread Daniele Bonetto
Ok, if the borrow throws an exceptin the obj was null. But i'm not sure that the invalidate was unnecessary. take a look at this: http://commons.apache.org/pool/apidocs/org/apache/commons/pool/ObjectPool.html Example of use: Object obj =|null|; |try| { obj = pool.borrowObject();

Re: [GenericObjectPool] problem with numActive counter

2010-01-15 Thread Simone Tripodi
In the example, the catch group catches exceptions that could be thrown by the object _use_, I *suppose* whenever you catch a java.util.NoSuchElementException you don't need to invalidate the object, that's what Mark was pointing. let us know, all the best, Simo On Fri, Jan 15, 2010 at 11:26 AM,

Re: [GenericObjectPool] problem with numActive counter

2010-01-15 Thread Daniele Bonetto
yes, but if i don't invalidate the object i continue to have the problem Timeout waiting for idle object that blocks my pool as u can see in the following examples... :( */Example 1: without invalidateObject/* MaxActive = 2 NumActive = 0 -- Network is ok. Borrow obj1 -- ok [numActive 1]

Re: [GenericObjectPool] problem with numActive counter

2010-01-15 Thread Mark Thomas
On 15/01/2010 10:59, Daniele Bonetto wrote: yes, but if i don't invalidate the object i continue to have the problem Timeout waiting for idle object that blocks my pool as u can see in the following examples... :( Which version of pool are you using? If not 1.5.4, try upgrading as there

Re: [GenericObjectPool] problem with numActive counter

2010-01-15 Thread Simone Tripodi
It sounds invalidating the object doesn't afflict the pool status, since in some cases you invalidate null. try following Mark suggestions. all the best, Simo On Fri, Jan 15, 2010 at 11:59 AM, Daniele Bonetto daniele.bone...@dnshosting.it wrote: yes, but if i don't invalidate the object i

Re: [GenericObjectPool] problem with numActive counter

2010-01-15 Thread Daniele Bonetto
I've already the latest version... :((( Other suggestions?? Daniele Il 15/01/2010 12.23, Mark Thomas ha scritto: On 15/01/2010 10:59, Daniele Bonetto wrote: yes, but if i don't invalidate the object i continue to have the problem Timeout waiting for idle object that blocks my pool

Re: [GenericObjectPool] problem with numActive counter

2010-01-15 Thread Daniele Bonetto
i've found the problem. it was fixed in the latest release (1.5.4), but rebuilding the source eclipse doesn't change the lib in webapp (that remains 1.5.2). i confirm that if borrowObject throws an exception the pool invalidates the broken object, so is unnecessary invalidate the object in

Re: [GenericObjectPool] problem with numActive counter

2010-01-15 Thread Simone Tripodi
don't worry, the community is here to solve problems :) Ciao ;) Simo On Fri, Jan 15, 2010 at 1:58 PM, Daniele Bonetto daniele.bone...@dnshosting.it wrote: i've found the problem. it was fixed in the latest release (1.5.4), but rebuilding the source eclipse doesn't change the lib in webapp