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);
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
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();
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,
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]
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
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
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
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
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
10 matches
Mail list logo