db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramin Moazeni (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-2905) Shutting down embedded Derby does not remove all code, the AutoloadDriver is left registered in the DriverManager.
Date Thu, 16 Aug 2007 23:27:31 GMT

     [ https://issues.apache.org/jira/browse/DERBY-2905?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ramin Moazeni updated DERBY-2905:
---------------------------------

    Attachment: Mainv1.java

Hello Dan,

Yes, the v0 patch was simpler however, I noticed that it has some problems.
Please consider the following scenario:
1) The DB is shut down and therefore, the Autoloaded driver is
unregistered.
2) The user tries to explicitly load the Embedded driver using
Class.forName(..).newInstance()

With v0 patch, the user couldn't load the Embedded driver explicitly after
the DB shutdown and I was getting the "No Suitable Driver" error.

I think the problem was that the DriverManager.registerDriver() was being
called in a static block and therefore it was called only once to load the
AutoloadedDriver. With the changes in v1 patch, the user can explicitly load the Embedded
driver after the DB shutdown and after the Autoloaded driver is being
unregistered. The AutoloadedDriver.registerDriverModule(...) takes care of registering the
driver when the user is explicitly loading the Embedded driver.

I am attaching a testcase with this issue. If you apply the v0 patch and run the
testcase, you will see the behavior I am explaining above.

Thanks
Ramin


> Shutting down embedded Derby does not remove all code, the AutoloadDriver is left registered
in the DriverManager.
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2905
>                 URL: https://issues.apache.org/jira/browse/DERBY-2905
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.2.2.0, 10.3.1.4, 10.4.0.0
>            Reporter: Daniel John Debrunner
>            Assignee: Ramin Moazeni
>         Attachments: DERBY-2905v0.diff, DERBY-2905v0.stat, DERBY-2905v1.diff, DERBY-2905v1.stat,
Main.java, Mainv1.java
>
>
> After a shutdown of the embedded driver the AutoloadDriver is not unregistered from DriverManager.
However it does not support any future loading of connections so it has no value in remaining
registered. Since the DriverManager class will remain forever, this means the Derby code will
remain forever in the JVM, even if Derby was loaded by a separate class loader.
> Regression from 10.1 since before the AutoloadedDriver the internal driver did unregister
itself from the DriverManager on a shutdown.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message