commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conrad CRAMPTON PSE 52704" <>
Subject [pool] validateObject not doing as stated in documentation
Date Wed, 04 Apr 2007 14:15:39 GMT
<quote>When testOnBorrow is set, the pool will attempt to validate each
object before it is returned from the borrowObject() method. (Using the
provided factory's
PoolableObjectFactory.validateObject(java.lang.Object) method.) Objects
that fail to validate will be dropped from the pool, and a different
object will be borrowed. </quote> from api docs for

The last bit about "a different object will be borrowed" doesn't appear
to work in my implementation.
The life cycle I am experiencing with the borrowObject method is
call to borrowObject
createObject is called ----> this is failing so I happen to return null
activateObject is called
validateObject is called ---> this is checking to see if object is null
(amongst other things) and returning false if null which is happening
however, I am getting an exception 
java.util.NoSuchElementException: Could not create a validated object,
cause: ValidateObject failed
thrown where I am expecting to get an attempt to create a different
object and this one to be destroyed.
The question is, what do I have to do to get this cycle to kick in on
false being returned from validateObject???

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message