--- Juozas Baliuka <[EMAIL PROTECTED]> wrote:
> 
> Looks like it is not a very good practice:
> 
>  /**
>      * Close a <code>Connection</code>, avoid closing if null and hide
>      * any exceptions that occur.
>      */
>     public static void closeQuietly(Connection conn) {
>         try {
>             close(conn);
>         } catch (SQLException sqle) {
>             // quiet
>         }
>     }

I agree that this isn't the best idea so I replaced calls to
closeQuietly() with DbUtils.close() in QueryRunner.

David

> 
> Some "clever" Connection implememtation can throw meaningfull
> exceptions:
> 
> if(Thread.currentThread() != openThread ){
>  throw new SQLException( Thread.currentThread() + " doe's not owns
> connection" );
> }
> 
> Logging is not the best practice to handle exeptions,
> I think it is better to clear all resources in nested finally blocks and
> delegate exeption handling for API user, or add new callback interface 
> with
> method
> "void handleThrowable(Throwable t)".
> 
> BTW "closeQuietly" hides SQLException only on "any exceptions that
> occur".
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to