6 Replies Latest reply on Apr 18, 2002 3:24 AM by drcharris

    2.4.5 cannot use XADataSourceLoader with XA driver?

    drcharris

      Trying out the 2.4.5RC1 release. Upgrading from 2.4.3 where we used an XA-compatible JDBC driver for our database connection, with our own DataSourceClass. Worked very well.

      Now with 2.4.5 we get ClassCastExceptions since XAConnectionFactory expects to be using XAConnectionImpl connections, which are JBoss specific.

      If I were using JBoss 3.0 I would expect this, and I would have to instead use a JDBC RA to connect to my database - is this the case for 2.4.5 also? I didn't think all the necessary support was in there.

      c

        • 1. Re: 2.4.5 cannot use XADataSourceLoader with XA driver?
          drcharris

          oops...should have mentioned we're using XADataSourceLoader

          Fragment of jboss.jcml is:


          DefaultDS
          com.inet.tds.XDataSource
          @dbuser@
          @dbpassword@
          false
          host=@dbhost@;database=@dbuser@
          1200000
          20
          false
          false
          false
          true
          120000
          1800000
          false
          1.0
          0


          (ignore the @ signs - we use Ant to configure this)

          c

          • 2. Re: 2.4.5 cannot use XADataSourceLoader with XA driver?
            davidjencks

            Oops, that is a problem.

            You should be able to use the jboss-xa.rar from 3.0 to wrap your xa driver and use with the 2.4.5 jca support if you want. However I think we need to fix this problem. Could you file a bug report?
            thanks
            david jencks

            • 3. Re: 2.4.5 cannot use XADataSourceLoader with XA driver?
              drcharris

              Ok I'll file a bug.

              I was looking at the RAR-approach anyway, so I'll give it a go. I assume I can just leave the RAR alone (put it under deploy/lib?), and configure a ConnectionFactoryLoader MBean and a RawXADataSourceLoader in jboss.jcml?

              Should be fun.

              • 4. Re: 2.4.5 cannot use XADataSourceLoader with XA driver?
                drcharris

                bug number is 542371

                • 5. Re: 2.4.5 cannot use XADataSourceLoader with XA driver?
                  drcharris

                  I've got the RAR approach working by pulling the jboss-xa.rar from the 3.0 beta as you suggested. The relevant ConnectionFactoryLoader (set for MS SQL 2000 using inet Opta2000 driver) looks like this:


                  DefaultDS
                  JCA:service=RARDeployer

                  Minerva JDBC XATransaction ResourceAdapter


                  UserName=@dbuser@
                  Password=@dbpassword@
                  XADataSourceClass=com.inet.tds.XDataSource
                  XADataSourceProperties=host=@dbhost@;database=@dbuser@



                  MinervaXACMFactory


                  # Pool type - uncomment to force, otherwise it is the default
                  #PoolConfiguration=per-factory

                  # Connection pooling properties - see
                  # org.jboss.pool.PoolParameters
                  MinSize=5
                  MaxSize=20
                  Blocking=true
                  GCEnabled=false
                  IdleTimeoutEnabled=false
                  InvalidateOnError=false
                  TrackLastUsed=false
                  GCIntervalMillis=120000
                  GCMinIdleMillis=1200000
                  IdleTimeoutMillis=1800000
                  MaxIdleTimeoutPercent=1.0



                  org.jboss.resource.security.ManyToOnePrincipalMapping



                  (where the bits between @ signs are things you will need to configure)

                  The only problem was with deployment ordering - the default configuration starts to deploy ejb-jars and webapps before the rar, so the datasource doesn't get bound into JNDI in time and JAWS starts complaining.

                  I fixed that by adding another AutoDeployer and setting the first one to look at ../deploy/lib and notify RARDeployer, the second one to look at ../deploy and notify J2EEDeployer. Seems to work quite well. For anyone else with the same problem, once you get the rar working replace your normal autodeployer with the following:



                  JCA:service=RARDeployer

                  ../deploy/lib




                  J2EE:service=J2eeDeployer

                  ../deploy


                  David thanks - that was very useful advice.

                  • 6. Re: 2.4.5 cannot use XADataSourceLoader with XA driver?
                    drcharris

                    OK actually I'm having problems with the RAR approach - no coordination between JDBC and MDBs right now, so an MDB that does some database access will never commit the database. But that's for another day...

                    Looks like Scott patched XAConnectionFactory to only do the cast if the connection object is of the right type
                    (http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jbosspool/src/main/org/jboss/pool/jdbc/xa/Attic/XAConnectionFactory.java?rev=1.2.2.4&content-type=text/vnd.viewcvs-markup)
                    so this should fix it.