2 Replies Latest reply on Jun 29, 2011 12:13 PM by msulliv1

    JMS-112 when connecting to Oracle AQ

    impio

      Hi I'm using JBoss 5.1 , and when my app tries to connect to oracle AQ through an XA datasource that is up and runs fine for other matters, I get this:

       

      oracle.AQ.AQException: JMS-112: Connection is invalid

      at oracle.AQ.AQDriverManager.createAQSession(AQDriverManager.java:193)

       

      oracle driver ojdbc14-10.1.0.4.0

       

       

      datasource config:

       

      <xa-datasource>

              <jndi-name>myjndiname</jndi-name>

              <use-java-context>false</use-java-context>

              <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:@server:port:schema</xa-datasource-property>

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

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

              <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

              <no-tx-separate-pools/>

              <mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter"

                     name="jboss.jca:service=OracleXAExceptionFormatter">

                  <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>

              </mbean>

      </xa-datasource>

        • 1. Re: JMS-112 when connecting to Oracle AQ
          impio

          Ok, simplifying, is there any way I can have a DataSource that does not provide wrapped connections? I need the class from the DS to be a java.sql.Connection. Anyone can help?

           

          Thanks

          • 2. Re: JMS-112 when connecting to Oracle AQ
            msulliv1

            Our project uses AQ connections and we need to unwrapp the datasource connection first:

             

            import org.jboss.resource.adapter.jdbc.WrappedConnection;
            ...

            WrappedConnection wrappedConn = (WrappedConnection)con;

            OracleConnection ocon =  null ;

            if (wrappedConn != null)
                 ocon = (OracleConnection) wrappedConn.getUnderlyingConnection();

             

             

             

             

            ..

            // then use ocon for connecting to AQ

             

            Hope that helps.