0 Replies Latest reply on Nov 20, 2012 9:51 AM by Marco Sarti

    XADatasource and Oracle RAC - Load Balancing

    Marco Sarti Newbie

      JBoss 4.2.3 GA - Oracle 11g RAC


      We have configured a XADatasource pointing to an Oracle RAC. When we get the connection from this datasource we do not obtain any load balancing, in other words every time we ask for a connection we obtain a connection to the same RAC node.

      How can we configure the DS in order to have a load balancing on the RAC nodes?


      Following the datasource configuration:






              <xa-datasource-property  name="URL">jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(protocol=tcp)(host=rac-scan)(port=xxx))(LOAD_BALANCE=YES)(CONNECT_DATA=(SERVE


          <xa-datasource-property name="User">XXXXXX</xa-datasource-property>

          <xa-datasource-property name="Password">YYYYYY</xa-datasource-property>





              <!--sql to call when connection is created-->

              <new-connection-sql>select 1 from dual</new-connection-sql>

              <!--sql to call on an existing pooled connection when it is obtained from pool-->

              <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 -->


          <!-- Checks the Oracle error codes and messages for fatal errors -->


          <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->