org.sonar.batch.bootstrap
Class JdbcDriverHolder

java.lang.Object
  extended by org.sonar.batch.bootstrap.JdbcDriverHolder

public class JdbcDriverHolder
extends Object

Contains and provides class loader extended with the JDBC Driver hosted on the server-side.


Constructor Summary
JdbcDriverHolder(ArtifactDownloader extensionDownloader)
           
 
Method Summary
 URLClassLoader getClassLoader()
           
 void stop()
          This method automatically invoked by PicoContainer and deregisters JDBC drivers, which were forgotten.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcDriverHolder

public JdbcDriverHolder(ArtifactDownloader extensionDownloader)
Method Detail

getClassLoader

public URLClassLoader getClassLoader()

stop

public void stop()
This method automatically invoked by PicoContainer and deregisters JDBC drivers, which were forgotten.

Dynamically loaded JDBC drivers can not be simply used and this is a well known problem of DriverManager, so workaround is to use proxy. However DriverManager also contains memory leak, thus not only proxy, but also original driver must be deregistered, otherwise our class loader would be kept in memory.

This operation contains unnecessary complexity because:



Copyright © 2009-2012 SonarSource. All Rights Reserved.