10 Replies Latest reply: Apr 18, 2013 11:45 AM by Joe Weinstein-Oracle RSS

    Weblogic Migration, JDBC doesn't support XA issue

    Vickram
      We are doing Weblogic Migration from WLS10.3.2 to WLS10.3.6 and Java from jdk1.6.0_26 to jdk1.7.0_07

      we are facing the following error for two modules which sends email but few other modules sending email are working fine :

      javax.transaction.xa.XAException: JDBC driver does not support XA, hence cannot be a participant in two-phase commit. To force this participation, set the GlobalTransactionsProtocol attribute to LoggingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source = ABATDataSource
      *[Wed Apr 10 08:40:03.069,<gzd4qc>] DEBUG (WorkRequestServiceImpl:sentEmailNotification) - Remote Exception occurred : javax.transaction.TransactionRolledbackException: BEA1-0020971AAD25AA29B1E3: javax.transaction.xa.XAException: JDBC driver does not support XA, hence cannot be a participant in two-phase commit. To force this participation, set the GlobalTransactionsProtocol attribute to LoggingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source = ABATDataSource*


      In Weblogic10.3.6, if we change the Datasource --> Transaction from one-phase commit to Logging Last Resource,
      this issue is getting resolved.

      But all the modules were working fine with one-phase commit in Weblogic10.3.2

      Could you kindly help us to fix this issue and problem in migration.
        • 1. Re: Weblogic Migration, JDBC doesn't support XA issue
          Vickram
          Could anyone please help us to resolve this issue.

          Also we would like to know below attributes briefly,

          1. Local Transaction

          2. Global Transaction

          3. One-phase commit

          4. Emulate Two-phase commit

          5. Logging Last Resource

          If we change from one-phase commit to LLR will there be any impact ?

          Thanks in advance.

          Regards,
          Vikram
          • 2. Re: Weblogic Migration, JDBC doesn't support XA issue
            Joe Weinstein-Oracle
            'local transaction' means there is one DBMS, and you start a tx (JDBC setAutoCommit(false)), do the work,
            then commit. 'Global transaction' means XA, with usually multiple DBMSes/resources in the tx, and a
            tx coordinator like WLS. The tx is started, work is done on multiple DBMSes/resources, then the tx
            coordinator does a 2-phase commit on all the resources. A non-XA resource can only one-phase
            commit (ie: you can only call commit). 'Emulate two-phase commit' is a hack to allow WLS to pretend
            a non-XA resource is XA, and do a fake prepare, then do the commit. This is a risk if the whole tx
            doesn't commit successfully. Logging Last Resource is an excellent way to engage one non-XA
            resource in a global transaction, with complete safety. The LLR resource is used for logging the
            XA transaction, and is committed as the first part of the second phase of the commit. As such it
            can be managed XA-wise whether that succeeds or fails.
            • 3. Re: Weblogic Migration, JDBC doesn't support XA issue
              Vickram
              Hi Joe,

              thanks a lot for the answers

              the issue is

              We are doing Weblogic Migration from WLS10.3.2 to WLS10.3.6 and Java from jdk1.6.0_26 to jdk1.7.0_07

              we are facing the following error for two modules which sends email but few other modules sending email are working fine :

              javax.transaction.xa.XAException: JDBC driver does not support XA, hence cannot be a participant in two-phase commit. To force this participation, set the GlobalTransactionsProtocol attribute to LoggingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source = ABATDataSource
              [Wed Apr 10 08:40:03.069,<gzd4qc>] DEBUG (WorkRequestServiceImpl:sentEmailNotification) - Remote Exception occurred : javax.transaction.TransactionRolledbackException: BEA1-0020971AAD25AA29B1E3: javax.transaction.xa.XAException: JDBC driver does not support XA, hence cannot be a participant in two-phase commit. To force this participation, set the GlobalTransactionsProtocol attribute to LoggingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source = ABATDataSource

              In Weblogic10.3.6, if we change the Datasource --> Transaction from one-phase commit to Logging Last Resource, this issue is getting resolved.

              But all the modules were working fine with one-phase commit in Weblogic10.3.2

              why i am getting this issue now in WLS 10.3.6 ?

              can you please advise. thanks in advance.

              Regards,
              K.Vickram
              • 4. Re: Weblogic Migration, JDBC doesn't support XA issue
                Joe Weinstein-Oracle
                increased safety checking in the later product. If you have only one non-XA resource, it is much best
                to set it as LLR.
                • 5. Re: Weblogic Migration, JDBC doesn't support XA issue
                  Vickram
                  Hi Joe,

                  Whether you are asking us to move to latest weblogic version ?

                  I have 4 datasources configured in weblogic for my application

                  The driver which we are using is "Oracle's Driver (Thin) for Instance Connections; Versions:9.0.1 and later"

                  Sample transactions in my application

                  One case

                  I will start a transaction and it gets connected to the Database through
                  the datasource in weblogic server and then it updates the data into the database which was given from the screen


                  Another case
                  I will start a transaction and it gets connected to the Database(2) through the datasource(2) in weblogic server and it
                  reads the data from database(2) and then it updates the data(which was read) into database(1)


                  For the above scenario will LLR will fit .

                  If you have only one non-XA resource. means referrring driver - can u eloborate

                  i dont know this was working in weblogic 10.3.2

                  can u pls advice . thanks

                  Thanks and Reagrds
                  K.Vickram
                  • 6. Re: Weblogic Migration, JDBC doesn't support XA issue
                    Joe Weinstein-Oracle
                    There is no blockage from making either/both Oracle Datasources to be XA, by using the
                    Oracle XA driver/datasource. As I'd said, it worked in earlier WLS because it didn't check as
                    well, and you're lucky you never had a tx fail with half the stuff committed and half not,
                    but if only one DBMS is being updated per tx, that would be safe anyway.
                    • 7. Re: Weblogic Migration, JDBC doesn't support XA issue
                      Vickram
                      Hi Joe,

                      Will there be any impact if i use now LLR according to 2 above transaction cases ( One case, Another case )? ,instead of onephase-commit ( as onephase-commit is throwing issue in wls10.3.6 ) - pls advise.

                      I just checked now in WLS 10.3.6 , We have a new option in data source ( GridLink Data Source )

                      Generic Data Source: Drivers
                      ============================
                      -> Oracle's Driver (Thin XA) for instance connections; Versions:9.0.1 and later
                      -> Oracles Driver (Thin XA) for RAC Service-Instance connections; Versions:10 and later
                      -> Oracles Driver (Thin XA) for Service connections; Versions:9.0.1 and later
                      -> Oracles Driver (Thin) for Instance connections; Versions:9.0.1 and later
                      -> Oracles Driver (Thin) for RAC Service-Instance connections; Versions:10 and later
                      -> Oracles Driver (Thin) for Service connections; Versions:9.0.1 and later
                      -> DataDirect's Oracle Driver (Type 4 XA) Versions:9.0.1 and later
                      -> DataDirect's Oracle Driver (Type 4) Versions:9.0.1 and later
                      -> Other


                      GridLink Data Source: Drivers
                      =============================
                      -> Oracle's Driver (thin XA) for GridLink Connections Versions:11 and later
                      -> Oracle's Driver (thin) for GridLink Connections; Versions:11 and later

                      Which is the best fit for my application considering the above 2 transaction cases ( One case , Another case )

                      If LLR is having no impact - shall i enable and use this ?

                      or

                      If GridLink Data Source can be used with Oracle's Driver (thin) for GridLink Connections; Versions:11 and later - - shall i enable and use this ?

                      or

                      I have to use Oracle's Driver (Thin XA) for instance connections; Versions:9.0.1 and later

                      Note : In WLS10.3.2 we were using ( one phase commit ) Oracles Driver (Thin) for Instance connections; Versions:9.0.1 and later

                      Please advise - it would be much helpful to us

                      thanks and Regards
                      Vickram

                      Edited by: Vickram on Apr 12, 2013 12:58 PM
                      • 8. Re: Weblogic Migration, JDBC doesn't support XA issue
                        Joe Weinstein-Oracle
                        Those are all the same driver, but the choices tell the console what to ask you regarding
                        further details about the parameters. For now, most simply, just set all your Oracle
                        datasources to XA, "Oracle's Driver (Thin XA) for instance connections; Versions:9.0.1 and later."
                        • 9. Re: Weblogic Migration, JDBC doesn't support XA issue
                          Vickram
                          Hi Joe,

                          We have changed the driver to XA ( Oracle's Driver (Thin XA) for instance connections; Versions:9.0.1 and later )
                          and we are getting the below issue in below case

                          CASE:
                          I will start a transaction and it gets connected to the Database through
                          the datasource in weblogic server and then it updates the data into the database which was given from the screen

                          Issue:
                          Caused by: java.sql.SQLException: Connection closed
                          at weblogic.jdbc.wrapper.JTAConnection.getXAConn(JTAConnection.java:213)
                          at weblogic.jdbc.wrapper.JTAConnection.checkConnection(JTAConnection.java:84)
                          at weblogic.jdbc.wrapper.ResultSetMetaData.preInvocationHandler(ResultSetMetaData.java:61)
                          at weblogic.jdbc.wrapper.ResultSetMetaData_oracle_jdbc_driver_OracleResultSetMetaData.getColumnCount(Unknown Source)

                          Hence i think i cannot go for XA driver....

                          It is working for Non XA driver with Logging Last Resource

                          As per your note
                          Logging Last Resource is an excellent way to engage one non-XA
                          resource in a global transaction, with complete safety. The LLR resource is used for logging the
                          XA transaction, and is committed as the first part of the second phase of the commit. As such it
                          can be managed XA-wise whether that succeeds or fails.

                          Can i keep as LLR itself

                          Will there be any impact for my applications for below transaction scenarios ?
                          One case
                          I will start a transaction and it gets connected to the Database through
                          the datasource in weblogic server and then it updates the data into the database which was given from the screen

                          Another case
                          I will start a transaction and it gets connected to the Database(2) through the datasource(2) in weblogic server and it
                          reads the data from database(2) and then it updates the data(which was read) into database(1)

                          I am also using EJB 3.0 version ( transaction-type - Container and Bean. Session-type - Stateless )


                          Note the changes

                          Previous Datasources details
                          X datasource points to a my db - Non XA driver with one phase commit
                          Y datasource points to a other db - Non XA driver with one phase commit

                          Issue :
                          javax.transaction.xa.XAException: JDBC driver does not support XA, hence cannot be a participant in two-phase commit. To force this participation, set the GlobalTransactionsProtocol attribute to LoggingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source = ABATDataSource
                          [Wed Apr 10 08:40:03.069,<gzd4qc>] DEBUG (WorkRequestServiceImpl:sentEmailNotification) - Remote Exception occurred : javax.transaction.TransactionRolledbackException: BEA1-0020971AAD25AA29B1E3: javax.transaction.xa.XAException: JDBC driver does not support XA, hence cannot be a participant in two-phase commit. To force this participation, set the GlobalTransactionsProtocol attribute to LoggingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source = ABATDataSource


                          Changed Datasources details
                          X datasource points to a my db - Non XA driver with LLR
                          Y datasource points to a other db - Non XA driver with one phase commit

                          Working


                          Can you please provide ur advise . thanks

                          Thanks and Regards
                          K.Vickram
                          • 10. Re: Weblogic Migration, JDBC doesn't support XA issue
                            Joe Weinstein-Oracle
                            Glad it's working. Use the LLR, and as long as the other DS,
                            the 1PC is read-only you're perfectly safe. As soon as you
                            start updating multiple DBMSes/DataSources, you want
                            one to be LLR and the others to be real XA. Open a support
                            case to solve any real XA problems.