4 Replies Latest reply on Nov 11, 2002 10:13 AM by Fernando

    MSSQL2000 XaDatasource properties

    Noel Rocher Apprentice


      Hi all,

      with the latest mssql2000 driver and jboss3.0.3-jetty


      I configured my xa datasource as this :
      ============================




      <config-property name="XADataSourceProperties" type="java.lang.String">ServerName=MY_IP_ADDRESS;PortNumber=MY_IP_PORT;selectMethod=cursor;ProgramName=JBoss;User=MY_USER;Password=MY_PASSWORD</config-property>

      <config-property name="XADataSourceClass" type="java.lang.String">com.microsoft.jdbcx.sqlserver.SQLServerDataSource</config-property>

      <config-property name="UserName" type="java.lang.String">MY_USER</config-property>
      <config-property name="Password" type="java.lang.String">MY_PASSWORD</config-property>


      ================================


      note : I replaced values by capital letter dummies


      When Datasource is created : no problems :
      ================================
      17:31:08,554 INFO [MainDeployer] Starting deployment of package: file:/D:/java/jboss-3.0.3/server/default/deploy/mssql-xa-service.xml
      17:31:08,754 WARN [ServiceController] jboss.jca:service=XATxDS,name=jdbc.mssql2000 does not implement any Service methods
      17:31:08,794 INFO [JBossManagedConnectionPool] Creating
      17:31:08,804 INFO [JBossManagedConnectionPool] Created
      17:31:08,804 INFO [JBossManagedConnectionPool] Starting
      17:31:08,804 INFO [JBossManagedConnectionPool] Started
      =================================



      When my EJB CMP2.0 are deployed I have this :
      ===================================

      17:31:16,095 INFO [EjbModule] Starting
      17:31:17,697 WARN [XAManagedConnectionFactory] No setter method for attribute selectMethod (value=cursor).
      17:31:17,897 WARN [ServiceController] Problem starting service jboss.j2ee:jndiName=ejb20/directory/LocationType,service=EJB
      org.jboss.deployment.DeploymentException: Error while fixing table name; - nested throwable: (java.sql.SQLException: Unable to get Connection: javax.resource.ResourceException: Unable to create DB XAConnection: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]JTA is not support when selectMethod=direct. Switch to selectMethod=cursor.)
      at org.jboss.ejb.plugins.cmp.jdbc.SQLUtil.fixTableName(SQLUtil.java:67)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.(JDBCEntityBridge.java:103)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:397)
      ====================================

      What do I missed ? Any idea ?

      Thanks,
      Noel

        • 1. Re: MSSQL2000 XaDatasource properties
          Simon McCarthy Newbie

          Noel

          I spent the whole of last week looking for this so I thought I'd let you out of your misery.

          If you want to use JTA with SQL Server, you have to copy a file called sqljdbc.dll from "SQLServer JTA" directory under installation of MS JDBC drivers the to the Binn directory of SQL Server. Then you have to use ISQL to add some stored procedures in instjdbc.sql, also shipped with the MS Jdbc driver. Then you add a datasource property

          <config-property name="selectMethod" type="java.lang.String">cursor</config-property>

          Obvious isn't it.

          When you connect, that's your problems really start.

          Hope this helps.

          Simon

          • 2. Re: MSSQL2000 XaDatasource properties
            Noel Rocher Apprentice

            Thanks for replying,


            Of course I've done this entire install process.


            I can see that there' s two ways to specify property value.

            The first as I mentionned (all in the same string separated by ";")
            The second is the one you mentionned by the specific tag for each property.

            What is confusing me is that when you read the JBoss console messages I provide here above, you can see that JBoss have the value for the "selectMethod" property but it isn't using it !

            Noel

            • 3. Re: MSSQL2000 XaDatasource properties
              Noel Rocher Apprentice

              OOOOOHHHHHHH NNNNNOOOOOOOOOOOO !

              I solved the problem ... All property names are CASE SENSITIVE !!!


              So much time for so few information !

              Cheers Simon

              Noel

              • 4. Re: MSSQL2000 XaDatasource properties
                Fernando Newbie

                Hello Noel,
                I want to configure the datasource to SQLServer 2000.
                Can you send me an example about it ?
                Thanks, Fernando.