DriverManager.deregisterDriver -> Driver.deregister

Lance Andersen - Oracle Lance.Andersen at oracle.com
Thu Mar 21 07:00:27 PDT 2013


The changes for this can be found at:

http://cr.openjdk.java.net/~lancea/8010416/webrev.00/

Best
Lance
On Jan 16, 2013, at 3:37 PM, Lance Andersen - Oracle wrote:

> Douglas has proposed the following which is under discussion/consideration if we have any runway after M6
> 
> ---------------------------------------------
> JDBC 4.2 should add a hook to Driver so that a Driver instance can be notified when it is deregistered. One approach would be:
> 
>  in java.sql.Driver
>  /** Do any local cleanup required when the entire driver is deregistered.
>   */
>  public void deregister(); // no exceptions
> 
> Then in the JavaDoc for DriverManager.deregisterDriver add:
> 
>  This method calls deregister() on the Driver being deregistered
>  if the method exists. If the Driver implements an older version
>  of the JDBC spec and does not implement the deregister() method
>  then no exception is thrown.
> 
> As it stands there is no way for a driver to know it has been deregistered. If it creates any resources on being loaded, there is no way for it to clean up those resources.
> 
> 
> ---------------------------------------------
> 
> 
> Best
> Lance
> 
> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
> Oracle Java Engineering 
> 1 Network Drive 
> Burlington, MA 01803
> Lance.Andersen at oracle.com
> 


Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
Lance.Andersen at oracle.com



More information about the jdbc-spec-discuss mailing list