db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TomohitoNakayama <tomon...@basil.ocn.ne.jp>
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:31:30 GMT
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

*/ 


Mime
View raw message