5 Replies Latest reply on Jul 23, 2003 2:18 AM by darranl

    Undeployment of JDBC Driver

    darranl

      Hi,

      I have been having a few problems with class loaders recently so I have been using a profilling tool to find out what object instances are in memory at various times.

      My application is packaged into a single ear file that amongst other things contains the JDBC drivers for MySQL and a mysql-ds.xml.

      After deploying the ear and running the application I can see that there are a number of instances of the MySQL classes in memory.

      After undeployment a lot of these instances disappear but a few remain.

      After undeployment does JBoss attempt to deregister the driver? Or are JDBC drivers left registered till the next time JBoss is restarted?

      The bahaviour is the same if I put the driver jar in lib and the mysql-ds.xml in deploy.

        • 1. Re: Undeployment of JDBC Driver
          darranl

          Sorry forgot to say this is on JBoss 3.2.1

          • 2. Re: Undeployment of JDBC Driver

            I have fixed the unregistration of the driver
            at undeploy, however I can't get redeploy of
            Driver classes to work.

            There is some horrible class caching somewhere
            in java.sql.Driver, it looks like a horrible attempt
            at security for applets judging by the hint
            in the javadocs.

            Regards,
            Adrian

            • 3. Re: Undeployment of JDBC Driver
              darranl

              Do you know if the Driver instance was garbage collected between your deployments?

              Is it possible that the static initialisation is not being called the second time the class is loaded?

              • 4. Re: Undeployment of JDBC Driver

                The Driver instance is garbage collected.
                The driver is re-registered with the DriverManager,
                but it doesn't use it.

                It says "skipping" if I set the logWriter to System.out,
                it seems to be caching the original class or classloader
                somewhere then saying I cannot use the driver
                because I would load a different class for the driver.

                Regards,
                Adrian

                • 5. Re: Undeployment of JDBC Driver
                  darranl

                  Adrian,

                  Just wanted to check to see if you have made any further progress on this issue?

                  Should this be logged as a bug at sourceforge so it can be tracked?