4 Replies Latest reply on May 7, 2009 12:34 AM by vickyk

    Jboss 5.0.1 & ha-local-tx-datasource

    mcrandal

      Hi,

      I am having an issue deploying a ha-local-tx-datasource into JBoss 5.0.1 (Java 6 version). local-tx-datasource works fine but when I deploy a ha datasource nothing seems to happen, i.e. nothing is logged to console, and the file appears in the web-console, but no datasource.

      This is the xml, from my -ds.xml file:

      <datasources>
       <ha-local-tx-datasource>
       <jndi-name>jdbc/DBConnection</jndi-name>
       <connection-url>jdbc:oracle:thin:@db1:1521:db1|jdbc:oracle:thin:@db2:1521:db2</connection-url>
       <url-delimiter>|</url-delimiter>
      
       <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
       <user-name>USERNAME</user-name>
       <password>PASSWORD</password>
      
       <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
       <min-pool-size>2</min-pool-size>
      
       <!-- The maximum connections in a pool/sub-pool -->
       <max-pool-size>20</max-pool-size>
      
       <!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered -->
       <check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
      
       <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
       <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
      
       <!-- Checks the Oracle error codes and messages for fatal errors -->
       <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      
       <!-- sql to call when connection is created
       <new-connection-sql>some arbitrary sql</new-connection-sql>
       -->
      
       </ha-local-tx-datasource>
      
      </datasources>
      


      If it helps this file works perfectly in JBoss 4.0.3

      Thanks for your help

        • 1. Re: Jboss 5.0.1 & ha-local-tx-datasource
          vickyk

          Yes, there is an issue of ha datasource getting deployed, I need to dig more here.
          I will look over this during the weekend.

          • 2. Re: Jboss 5.0.1 & ha-local-tx-datasource
            mcrandal

            Have been looking a bit more at this and seems that, according to the jboss-ds_1_5.dtd
            , the local-tx-datasource type of datasource takes a url-delimiter. And when I deploy with

            <datasources>
             <local-tx-datasource>
             <jndi-name>jdbc/BOB-DS</jndi-name>
             <connection-url>jdbc:oracle:thin:@db1:1521:db1|jdbc:oracle:thin:@db2:1521:db2</connection-url>
             <url-delimiter>|</url-delimiter>
            
             <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
             <user-name>USERNAME</user-name>
             <password>PASSWORD</password>
            
             <min-pool-size>2</min-pool-size>
             <max-pool-size>20</max-pool-size>
            
             <check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
             <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
             <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
             </local-tx-datasource>
            </datasources>
            
            


            All seems fine. Though I have NOT tested the failover capability.

            • 3. Re: Jboss 5.0.1 & ha-local-tx-datasource
              msaheb

              Hi

              According to the last message posted here, does it mean that to define failover capabilities, ha-XXXX-datasource is not needed in JBoss 5?

              • 4. Re: Jboss 5.0.1 & ha-local-tx-datasource
                vickyk

                 

                "maliksaheb" wrote:
                Hi

                According to the last message posted here, does it mean that to define failover capabilities, ha-XXXX-datasource is not needed in JBoss 5?

                Yes, check the corresponding test case related -ds.xml configuration files here
                https://anonsvn.jboss.org/repos/jbossas/trunk/testsuite/src/resources/jca/ha/

                Here is the corresponding -ds.xml files from older Jboss configuration

                http://anonsvn.jboss.org/repos/jbossas/branches/JBPAPP_4_2/testsuite/src/resources/jca/ha

                You will notice that there is change from ha-local-tx-datasource to local-tx-datasource in the configuration.