7 Replies Latest reply on Jul 3, 2003 10:28 AM by sashahunt

    Oracle XA setup problem

    sashahunt

      Hello,
      Can anyone tell me what is wrong with my
      oracle-xa-service.xml file? I'm using jboss-3.0.7_jakarta-tomcat-4.1.24 with Oracle 9.2.0.2.1 on Windows 2000. I get an error when trying to perform
      a getConnection using the java:/XAOracleDS.
      I don't have any client-side oracle installed if that makesa difference, but do have all the .dlls inthe PATH.

      Note that I got this file from the "examples" directory
      in the distribution and I fixed the reference to InformixDS in my login-config.xml

      <?xml version="1.0" encoding="UTF-8"?>

      <!-- ===================================================================== -->
      <!-- -->
      <!-- JBoss Server Configuration -->
      <!-- -->
      <!-- ===================================================================== -->




      <!-- ==================================================================== -->
      <!-- ConnectionManager setup for xa oracle dbs -->
      <!-- Thanks to igor fedorenko <ifedorenko@thinkdynamics.com> -->
      <!-- Build jmx-api (build/build.sh all) and view for config documentation -->
      <!-- YOU MUST CHANGE THE XidFactoryMBean config (in conf/jboss-service.xml -->
      <!-- or transaction-service.xml) to this: -->
      <!--

      true

      -->
      <!-- ==================================================================== -->




      <depends optional-attribute-name="ManagedConnectionFactoryName">
      <!--embedded mbean-->


      <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss JDBC XATransaction ResourceAdapter

      <!--real attributes -->


      <config-property name="XADataSourceProperties"
      type="java.lang.String">URL=jdbc:oracle:oci:@(description=(address=(host=cat-3.mycorp.com)(protocol=tcp)(port=1521))(connect_data=(sid=student)))</config-property>
      <config-property name="XADataSourceClass"
      type="java.lang.String">oracle.jdbc.xa.client.OracleXADataSource</config-property>
      <config-property name="IsSameRMOverrideValue" type="java.lang.Boolean">false</config-property>

      <!--set these only if you want only default logins, not through JAAS -->
      <config-property name="UserName"
      type="java.lang.String"></config-property>
      <config-property name="Password"
      type="java.lang.String"></config-property>
      <!--
      Do not try to set transaction isolation level here or you'll get
      java.sql.SQLException: ORA-01453: SET TRANSACTION must be first statement of transaction
      Read committed is a default isolation level for Oracle, so there
      is not real need to set it here. I'll take a look into it later ...maybe.
      <config-property name="TransactionIsolation"
      type="java.lang.String">TRANSACTION_READ_COMMITTED</config-property>
      -->


      XAOracleDS



      <depends optional-attribute-name="ManagedConnectionPool">
      <!--embedded mbean-->


      0
      50
      5000
      15
      <!--criteria indicates if Subject (from security domain) or app supplied
      parameters (such as from getConnection(user, pw)) are used to distinguish
      connections in the pool. Choices are
      ByContainerAndApplication (use both),
      ByContainer (use Subject),
      ByApplication (use app supplied params only),
      ByNothing (all connections are equivalent, usually if adapter supports
      reauthentication)-->
      ByContainer


      <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager

      <!-- Include a login module configuration named OracleXaDbRealm.
      Update your login-conf.xml, here is an example for a
      ConfiguredIdentityLoginModule:

      <application-policy name = "OracleXaDbRealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
      <module-option name = "principal">yourprincipal</module-option>
      <module-option name = "userName">yourusername</module-option>
      <module-option name = "password">yourpassword</module-option>
      <module-option name = "managedConnectionFactoryName">jboss.jca:service=XATxCM,name=InformixXaDS</module-option>
      </login-module>

      </application-policy>

      NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
      module-option name = "managedConnectionFactoryName"
      must match the object name of the ConnectionManager you are configuring here.
      -->
      <!--uncomment out this line if you are using the OracleXaDbRealm above BETH -->
      OracleXaDbRealm


      <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager

      java:/TransactionManager



        • 1. Re: Oracle XA setup problem
          frito

          Do not X post. Wrong forum.

          Greetings,
          Frito

          • 2. Re: Oracle XA setup problem
            sashahunt

            Hi,

            It's to make my oracle calls within my MDB work within the MDB transaction and sessions. Perhaps there is a different way to do this????

            • 3. Re: Oracle XA setup problem

              Try changing InformixXaDS to OracleXaDS.
              Also go to the database config forum until you can
              get
              new InitialContext().lookup("java:/OracleXaDS");
              to work.

              Regards,
              Adrian

              • 4. Re: Oracle XA setup problem
                sashahunt

                Thanks,

                I had already fixed the reference to Informx in the login-config.xml (see Note above), and the lookup from InitialContext works. When I try to actually get a DB connection is when the failure happens. Note that I can get the connection to the same database using a thin driver and the oracle-service.xml, but I need to support DB inside my MDB transactions....




                • 5. Re: Oracle XA setup problem

                  What error do you get then?

                  You should just lookup the datasource and get the connection. If it works elsewhere I don't see why
                  it won't work from an MDB.

                  Regards,
                  Adrian

                  • 6. Re: Oracle XA setup problem
                    sashahunt

                    The XA does not work elsewhere, only the non-XA.

                    Do I need a client-side oracle? Should I use the
                    oci8 or oci driver? Do you know if this one works with Oracle 9 ?

                    • 7. Re: Oracle XA setup problem
                      sashahunt

                      Is my specification valid and consistent with what the oracle-xa-service.xml was tested/run with? Or do I have to set up tnsnames ??

                      URL=jdbc:oracle:oci:@(description=(address=(host=cat-3.mycorp.com)(protocol=tcp)(port=1521))(connect_data=(sid=student)))