db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: svn commit: r349718 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/jdbc/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/ testing/org/apache/derbyTesting/functionTe...
Date Tue, 29 Nov 2005 14:11:51 GMT
tmnk@apache.org wrote:

/impl/jdbc/EmbedClob.java?rev=349718&r1=349717&r2=349718&view=diff
> ==============================================================================
> --- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java (original)
> +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java Tue Nov
29 06:02:22 2005
> @@ -251,8 +251,17 @@
>  			}
>  			finally
>  			{
> -				if (clobReader != null)
> -					clobReader.close();
> +			    if (clobReader != null){
> +				
> +				try{
> +				    clobReader.close();
> +				    
> +				}catch(IOException e){
> +				    e.printStackTrace();
> +				    throw new SQLException(e.getMessage());
> +				    
> +				}
> +			    }

The error handling is incorrect here, and I think in at least one other
place in the patch.

1) Derby should not be printing stack traces to System.err, it should
just throw an exception. It's up to the calling application to print the
stack trace, if it wants.

2) There are utility methods, e.g. noStateChangeLOB, to create new
SQLExceptions, creating an exception like this will not include a
SQLState and will not link the original IOException to the SQLException.

Thanks,
Dan.




Mime
View raw message