commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Verbeeck <dirk.verbe...@pandora.be>
Subject Re: [Pool] GenericObjectPool borrowObject() method needs minor patch
Date Mon, 10 Nov 2003 14:33:32 GMT
I have updated the offending line:
    throw new NoSuchElementException("Could not create a validated object, 
cause: " + e.getMessage());

-- Dirk


Chris Handorf wrote:

> Look at the borrowObject() code at the following link:
> 
> http://jakarta.apache.org/commons/pool/xref/org/apache/commons/pool/ 
> impl/GenericObjectPool.html
> 
> specifically, the following lines of code caused me much grief:
> 
> 831             try {
> 832                 _factory.activateObject(pair.value);
> ...
> 837             }
> 838             catch (Exception e) {
> ...
> 850                 if(newlyCreated) {
> 851                     throw new NoSuchElementException("Could not  
> create a validated object");
> 
> When factory.activateObject() throws an Exception, it would be nice to  
> know what the Exception is instead of having it caught and obscured  
> with a less meaningful error message.
> 
> In my case, the JDBC driver was failing with a "does not support  
> read-only mode" error.
> If that error had been printed I could have solved this problem in 1  
> minute instead of one day. I'm past it now but I thought I would pass  
> this on in hopes that it will help somebody else.
> Maybe one of the developers will read this post????



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


Mime
View raw message