[ 
http://issues.apache.org/jira/browse/DERBY-819?page=comments#action_12363832 ] 

Daniel John Debrunner commented on DERBY-819:
---------------------------------------------

-1
The use of InternalDriver.activeDriver() to obtain a factory exposes Derby to 
potential NullPointerExceptions in a shutdown or error on boot situation. I see 
that you saw one in your testing as you have a comment on that in the shutdown 
code.  Such NPEs will hide the real error from users, making Derby harder to 
use.

I think the solution is to move some of the code from 
java/engine/org/apache/derby/impl/jdbc/Util.java to be factory methods  on 
InternalDriver. or methods on EmbedConnection or EmbedConnectionChild. I think 
you will find that most, if not all, cases these static Util methods are called 
from a JDBC implementation object which has a reference to its InternalDriver 
factory. Such a change would then remove the need for special code in the 
shutdown case. Basically this move to a factory based allocation for 
SQLException obejcts should make the Util class go away.

Also the new patch is missing the test code.

> Provide JDBC4 SQLException subclasses support in Embedded driver
> ----------------------------------------------------------------
>
>          Key: DERBY-819
>          URL: http://issues.apache.org/jira/browse/DERBY-819
>      Project: Derby
>         Type: Sub-task
>   Components: JDBC
>  Environment: all
>     Reporter: Anurag Shekhar
>     Assignee: Anurag Shekhar
>     Priority: Minor
>  Attachments: derby-819.diff, stat.out
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to