Announcement Announcement Module
Collapse
No announcement yet.
XA Environment Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • XA Environment

    I dont understand why we need XA environment when updating 2 different databases in one transaction.

    Code:
    try {
      service1.doIt() // database1 upadted
      service2.doAnother() // database2 updated
    } catch (Exception e) {
      log e 
      throw e
    }
    when an exception occurs, spring automatically calls setRollbackOnly() which will rollback both database updates. If this is the case, why do we need XA?

  • #2
    what if the call to commit on the second db fails after you've already committed on the first db?

    You have a limited understanding of distributed computing, failure modes and ACID properties, among other things.

    You are right, in a perfect world, where things never go wrong, machines don't crash and people don't pull power plugs accidentally, you don't need XA. For those of us living in the real world, however, it is a requirement in the scenario you provide IF we are to make any guarantees about the consistency of the database with regards to our application.

    Comment


    • #3
      Thanks for your reply.

      Yes. I do have limited understanding of lot of things, and thats the reason I asked this question. 'Genius' people like you should try to answer the question rather than empty talk. Except for the first line of your answer, the rest is uncalled for.

      Anyway, thanks for the reply.

      Comment


      • #4
        I wholeheartedly agree with this last post. The comments were unnecessary and would suggest that they were made by someone who lacks experience working with others.

        Comment


        • #5
          Originally posted by cf0051 View Post
          I wholeheartedly agree with this last post. The comments were unnecessary and would suggest that they were made by someone who lacks experience working with others.
          I'm sorry if my reply to the question wasn't 'humble' enough for either of you. But I stand by my original assessment that the OP would be well served to read up on the topic as the general question "why do I need XA" is a little to broad to answer on a message forum (other than my original glib reply). I'd suggest these as a start:

          XA Exposed I
          XA Exposed II

          If you want a more academic perspective on distributed systems/computing in general, you might want to read some of the seminal papers by Leslie Lamport or the original paper on two phase commit (the basis of XA).

          Timeclocks in distributed systems
          Byzantine Generals Problem
          Distributed Snapshots

          Two Phase Commit

          Comment


          • #6
            You don't have to be humble. Just don't be arrogant. While I don't know about your technical credentials, I agree with the other post that you need people skills. Here is lesson 101: There are no stupid questions, there are only stupid people.

            Comment


            • #7
              Originally posted by jrachel View Post
              You don't have to be humble. Just don't be arrogant. While I don't know about your technical credentials, I agree with the other post that you need people skills. Here is lesson 101: There are no stupid questions, there are only stupid people.
              I find your 'arrogant' assessment of my interpersonal skills no less offensive than you found my assessment of your understanding of XA.
              Think about it....

              Comment


              • #8
                Exactly. Now you know the taste of your own medicine. I'm glad you understood.

                Comment

                Working...
                X