db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Noll <dan...@nuix.com>
Subject Derby and handling of exceptions / errors
Date Tue, 13 Jan 2009 22:20:13 GMT
Hi all.

I've noticed that Derby appears to be catching Throwable somewhere 
internally, and thus is absorbing exceptions which should normally not 
be caught.  This means that ultimately the user isn't seeing the correct 
exception as it is claiming a problem with the database where they 
really should be seeing the error dialog about the system being out of 
memory.

I can do this:

   try {
     connection.prepareStatement(...).executeQuery()...
   } catch (SQLException e) {
     if (e.getCause() instanceof Error) {
       throw (Error) e.getCause();
     } else if ...
   }

This appears to catch situations I'm seeing in the logs, but is it okay 
to assume that the OOMEs and such will only be one level deep inside the 
exception hierarchy?

Daniel


-- 
Daniel Noll                            Forensic and eDiscovery Software
Senior Developer                              The world's most advanced
Nuix                                                email data analysis
http://nuix.com/                                and eDiscovery software

Mime
View raw message