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

Lily Wei updated DERBY-2905:
----------------------------

    Attachment: DERBY-2905-2.diff

Thanks Knut and Kathey.  I think shutdown=true should shutdown the  entire 
system and deregister the driver as document. DERBY-2905-2.diff is implementing 
that. In AutoloadDriver, the _autoloadedDriver is to keep track of the 
AutoloadedDriver when getConnection is called the first time and did not get 
trigger on the following calls. This implementation did not truly implement 
deregister=true other than introduce the attribute.  I am posting the patch to 
make sure we agree on the proposal and whether I am on the right trace of 
fixing this issue. 

To summary the current proposal: 
shutdown=true will shutdown the entire system and deregister the driver as 
document. On top of that, we will introduce deregister attribute. If 
deregister=false, we will keep the autoloading idiom and allow further 
getConnection after that. The default behavior for shutdown will be setting 
deregister=true. 

Some note about the patch:
Driver20.stop will deregister the driver as document when shutdown attribute is 
set. No change is needed.

EmbeddedDataSource.java If AutoloadedDriver has been deregister from previous 
shutdown, just get the current driver.

Attribute.java introduce deregister attribute

AutoloadedDriver: handle register and deregister driver. i.e. AutoloadedDriver, 
Driver40(other if using different version of jvm) Need to know whether it is 
register driver the first time or after AutoloadedDriver has been initiated. I 
am using _driverModule to keep track of the derby driver and _autoloadedDriver 
to keep track of the AutoloadedDriver object. 

What is not implemented? The work of deregister=false. 

Suites.all runs clean.  


> 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.1.3
>            Reporter: Daniel John Debrunner
>            Assignee: Lily Wei
>         Attachments: DERBY-2905-2.diff, DERBY-2905_1.diff, DERBY-2905v0.diff, 
> DERBY-2905v0.stat, DERBY-2905v1.diff, DERBY-2905v1.stat, DERBY-2905v3.diff, 
> DERBY-2905v3.stat, Main.java, Mainv1.java, Repro2905.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.

Reply via email to