3 Replies Latest reply on May 20, 2002 11:58 PM by Greg Turner

    Possible Bug in JBoss 3.0.0RC2 JCA ?

    Greg Turner Apprentice

      I use a Cloudscape db. In upgrading my app from JBoss 2.4.4 to JBoss 3.0.0RC2, I discovered by stepping thru the code in my debugger that during startup in LocalManagedConnectionFactory.createManagedConnection
      Connection con = getDriver().connect(internalGetConnectionURL(), new Properties(props));
      returned a null Connection, inspite of it using the same url as was used in 2.4.4.

      I wrote a simple client program to connect to the database in the same way that JBoss 3.0.0RC2 does and verified that the Connection was not being gotten.

      Class c = Class.forName("COM.cloudscape.core.RmiJdbcDriver");
      Driver d = (Driver)c.newInstance();
      Connection conn = d.connect(url, props);

      I then noticed that my JDBC book implies that the proper way to get the Driver explicitly is to do it this way:

      Class.forName ("COM.cloudscape.core.RmiJdbcDriver").newInstance();
      Driver d = DriverManager.getDriver (url);
      Connection conn = d.connect(url, props);

      And my client program verified that this way worked.

      So I am wondering if this is a bug in LocalManagedConnectionFactory or perhaps not if no one else has had this problem.


        • 1. Re: Possible Bug in JBoss 3.0.0RC2 JCA ?
          Greg Turner Apprentice

          Further discussion: Driver implementations register themselves with the DriverManager when Class.forName() is called by virture of the fact that the implementation is written with a static initializer that instantiates the class and calls DriverManager.registerDriver(). I decompiled the Cloudscape driver to discover that is is written in such a way as to render itself useless if it is not instantiated by the static initializer. My JDBC book is hazy about if instantiation of the driver outside the static initializer is OK. So, David, hoping that you are reading this, if your reading of the JDBC spec says that JBoss is doing it OK, then I will consider Cloudscape to not be doing it right and will drop it and look for another database. What say?

          • 2. Re: Possible Bug in JBoss 3.0.0RC2 JCA ?
            David Jencks Master

            I think I need to change the Local wrapper to use DriverManager. Sigh...

            • 3. Re: Possible Bug in JBoss 3.0.0RC2 JCA ?
              Greg Turner Apprentice

              Sorry to be the bearer of the news. One of these days, soon, I will ramp myself up to being able to work with CVS and help with code fixes. ;-)