You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Daniel John Debrunner <dj...@debrunners.com> on 2005/11/29 15:11:51 UTC

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...

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.




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...

Posted by TomohitoNakayama <to...@basil.ocn.ne.jp>.
Hello.

Thanks. Ididn't know the rule about printing stackTrace and Exception.
I will reopen DERBY-721.

Best regards.

Daniel John Debrunner wrote:

>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.
>
>
>
>
>
>  
>

-- 
/*

        Tomohito Nakayama
        tomonaka@basil.ocn.ne.jp
        tomohito@rose.zero.ad.jp
        tmnk@apache.org

        Naka
        http://www5.ocn.ne.jp/~tomohito/TopPage.html

*/