0 Replies Latest reply on Oct 1, 2008 8:06 AM by Tschungel Buch

    Oracle Failover, Oracle AQ and JNDI Lookup

    Tschungel Buch Newbie

      We are running our Oracle Database in a failover mode:

      DB.INT.SERVER.COM=
       (DESCRIPTION=
       (ADDRESS_LIST=
       (FAILOVER=on)
       (LOAD_BALANCE=off)
       (ADDRESS=
       (PROTOCOL=TCP)
       (HOST=server1.int.server.com)
       (PORT=1521)
       )
       (ADDRESS=
       (PROTOCOL=TCP)
       (HOST=server2.int.server.com)
       (PORT=1521)
       )
       )
       (CONNECT_DATA=
       (FAILOVER_MODE=
       (TYPE=session)
       (METHOD=basic)
       (RETRIES=180)
       (DELAY=5)
       )
       (INSTANCE_NAME=DB)
       (SERVICE_NAME=DB.INT.SERVER.COM)
       )
       )
      


      We address this in the JNDI datasource file
      <?xml version="1.0" encoding="UTF-8"?>
      
      <!-- ===================================================================== -->
      <!-- ORACLE DATASTORE for JBOSS -->
      <!-- JBoss Server Configuration -->
      <!-- -->
      <!-- P.R.O.D.U.C.T.I.O.N -->
      <!-- -->
      <!-- ===================================================================== -->
      
      <datasources>
       <local-tx-datasource>
       <jndi-name>main-oracle-datasource</jndi-name>
       <connection-url>
       jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST =
       (LOAD_BALANCE = off) (FAILOVER = on)
       (ADDRESS = (PROTOCOL = TCP) (Host = server1.int.server.com)(Port = 1521) )
       (ADDRESS = (PROTOCOL = TCP) (Host = server2.int.server.com)(Port = 1521)) )
       (CONNECT_DATA = (SERVICE_NAME = DB.INT.SERVER.COM)
       (INSTANCE_NAME = DB) (FAILOVER_MODE =(TYPE = session)
       (METHOD = BASIC) (RETRIES = 180) (DELAY = 5) ) ) )
       </connection-url>
       <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
       <user-name>user-name</user-name>
       <password>pass-word</password>
      
       <min-pool-size>5</min-pool-size>
       <max-pool-size>50</max-pool-size>
      
       <!-- 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>select 1 from dual</new-connection-sql>
      
       <!-- 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>
      
       <metadata>
       <type-mapping>Oracle9i</type-mapping>
       </metadata>
       </local-tx-datasource>
      
      </datasources>
      


      Now my question how can a use the data source definition to define the access to the oracle aq system.
      Currently it is done in the jboss-esb.xml
      <jms-provider name ="JBossOracleQ"
       connection-factory ="QueueConnectionFactory">
       <property name="java.naming.factory.initial" value="org.jboss.soa.esb.oracle.aq.AQInitialContextFactory"/>
       <property name="java.naming.oracle.aq.user" value="user-name"/>
       <property name="java.naming.oracle.aq.password" value="pass-word"/>
       <property name="java.naming.oracle.aq.server" value="server1.int.server.com"/>
       <property name="java.naming.oracle.aq.instance" value="db"/>
       <property name="java.naming.oracle.aq.schema" value="user-name"/>
       <property name="java.naming.oracle.aq.port" value="1521"/>
       <property name="java.naming.oracle.aq.driver" value="thin"/>
      
       <jms-bus busid="quickstartGwChannel">
       <jms-message-filter dest-type="QUEUE"
       dest-name="ACTION_REQUEST" />
       </jms-bus>
      
       <jms-bus busid="quickstartEsbChannel">
       <jms-message-filter dest-type="QUEUE"
       dest-name="B" />
       </jms-bus>
      </jms-provider>
      
      


      We this we have a server dependent jboss configuration, which is not very nice.

      Thank you for any help.

      Rene