6 Replies Latest reply on Jul 10, 2007 3:56 AM by mcbeth

    Distributed Transactions without Transaction

    mcbeth

      Till this moment we use local transactions, but we have multiple connections to different databases. But we should use distributed transactions, because of complete rollbacks.
      No we want to transfer to the distributed transactions and have one problem: In some cases we want to write something to the database WITHOUT any transaction (logfile). In this case nothing happens. No exception and everything seems allright, but no data in the database.

      If possible, there should not be another database connection for the changes without transaction.


      Thanks in advance.
      Andreas

        • 1. Re: Distributed Transactions without Transaction
          jhalliday

          Mark the logging methods of the EJB with transaction attribute RequiresNew.

          • 2. Re: Distributed Transactions without Transaction
            mcbeth

            Thanks for your answer. We have to try this. But is there no chance to write some data to the db whithout transaction, and the rest with transaction?

            grettings

            Andreas

            • 3. Re: Distributed Transactions without Transaction
              jhalliday

              Please clarify how the effect you are trying to achieve differs from the one you get with the above suggestion.

              • 4. Re: Distributed Transactions without Transaction
                mr_dronski

                 

                "mcbeth" wrote:
                Thanks for your answer. We have to try this. But is there no chance to write some data to the db whithout transaction, and the rest with transaction?


                Typically you can achieve it by using the NotSupported TX attribute, the current thread's TX is then suspended and consequently resumed.

                • 5. Re: Distributed Transactions without Transaction
                  mcbeth

                   

                  "jhalliday" wrote:
                  Please clarify how the effect you are trying to achieve differs from the one you get with the above suggestion.


                  I will try your suggestion, but this will take a while.


                  "mr_dronski" wrote:
                  Typically you can achieve it by using the NotSupported TX attribute, the current thread's TX is then suspended and consequently resumed.


                  We use this. the method in the sessionbean, that runs the business, has the transaction attribute NotSupported in ejb-jar. The datasource itself is configured as xa datasource. When we run this business, it seemed to work ok - no exceptions. The client programm see the db-entries. But with another db client (querybrowser from mysql) there are no entries in the db. And after some minutes (maybe 5) olso the normal application client don`t see any data in this table.

                  greets andreas

                  • 6. Re: Distributed Transactions without Transaction
                    mcbeth

                     

                    "jhalliday" wrote:
                    Please clarify how the effect you are trying to achieve differs from the one you get with the above suggestion.


                    This works like expected thanks for your help