commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniele Bonetto <>
Subject problem with numActive counter
Date Fri, 15 Jan 2010 09:53:15 GMT
Hello everyone!

I notice a problem using GenericObjectPool.

My code is like this:

         Object obj = null;
                 obj = this.borrowObject();
         catch(NoSuchElementException ex)
             log.error("no such element exception", ex);
             throw new NicProviderPoolException("no such element 
exception", ex);
         catch(Exception ex)
             log.error("exception", ex);
             throw new Exception("exception", ex);
         return (NicProvider)obj;

When the borrowObject throws an exception and i invalidate the 
borrowedObject the numActive counter was decreased by 1. The problem is 
that the counter will not be increased in case of exception... So, my 
numActive counter will be -1 and isn't correct.

Someone has noticed this problem too?

Thanks in advance,

Daniele Bonetto

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

View raw message