0 Replies Latest reply on Jul 15, 2014 5:03 AM by mkandrat

    Issues with two dataSources in Jboss5.1.0

    mkandrat

      Hi,

       

        I am using Jboss5.1.0 for my application with EJB, Hibnernate and Oracle11g.

       

      As like below I have two xa-datasource in my oracle-ds.xml and each pointing to two different DB server. Both DB has there own separate schema here there is concept of failover.

      And we have two separate processes each pointing to different DB. For ex, Process1 points to dbServer1 and Process2 points to dbServer2.

       

           <xa-datasource>

            <jndi-name>OracleDS</jndi-name>

            <!-- uncomment to enable interleaving <interleaving/> -->

            <isSameRM-override-value>false</isSameRM-override-value>

            <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>

            <xa-datasource-property name="URL">jdbc:oracle:thin:@dbServer1:1521:dbServer1</xa-datasource-property>

          </xa-datasource>

          <xa-datasource>

                <jndi-name>OracleDS1</jndi-name>

                <!-- uncomment to enable interleaving <interleaving/> -->

                <isSameRM-override-value>false</isSameRM-override-value>

                <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>

                <xa-datasource-property name="URL">jdbc:oracle:thin:@dbServer2:1521:dbServer2</xa-datasource-property>

          </xa-datasource>

       

        Now the problem is, if dbServer2 goes down, my Process1 also got crashed and goes down. Below is the exception i am getting in process1.

       

      Caused by: org.jboss.util.NestedSQLException: Unable to get managed connection for OracleDS1; - nested throwable: (javax.resource.ResourceException: Unable to get managed connection for db)

          at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)

          ... 70 more

      Caused by: javax.resource.ResourceException: Unable to get managed connection for OracleDS1

          at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:441)

          ... 72 more

      Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: ORA-01033: ORACLE initialization or shutdown in progress

          at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:465)

          .. 76 more

      Caused by: java.sql.SQLException: ORA-01033: ORACLE initialization or shutdown in progress

       

      Please anyone help me on this issue asap.

       

      Thanks,

      Riyaz