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

  • Transaction boundaries

    Hi all,

    I've a weird question. I am not even sure my requirement is appropriate one.
    Let's say I've Transaction area A, B, C. The execution will go from A->B->C.

    What I want is Transaction in area B to commit but A and C can be rolled back. Is that even possible because I believe that violates ACID nature of transactions.

    If possible, please share your suggestion/experience with me. I am able to use any spring related Tx API.

    Thanks,
    Aung

  • #2
    I'm no expert but I don't think you can do that, you potentially want to rollback something that has already been commited.
    Last edited by karldmoore; Aug 29th, 2007, 10:04 AM.

    Comment


    • #3
      Need to use REQUEST_NEW propagation

      You need to use REQUIRES_NEW propagation for B, in this way, the transaction manager will suspend transaction for A, create a new transaction for B, commit B, and then resume first transaction for A and C.

      Comment


      • #4
        Originally posted by Caladan View Post
        You need to use REQUIRES_NEW propagation for B, in this way, the transaction manager will suspend transaction for A, create a new transaction for B, commit B, and then resume first transaction for A and C.
        But note, that in this case transaction B (most likely) would not see work performed in part A. Really, it depends on transaction isolation level and implementation of database/transaction manager.

        Comment


        • #5
          But note, that in this case transaction B (most likely) would not see work performed in part A. Really, it depends on transaction isolation level and implementation of database/transaction manager.

          Yes you're right, if B need to see what has been done by A, select a READ_UNCOMMITED isolation level but need to be carefull with READ_UNCOMMITED, if B need to see information from another transaction (let say D), then it will also see it before it is committed, if A, B AND C are committed later but D, that can cause data integrity problem.

          Comment


          • #6
            I think the general moral is be careful with this stuff .
            Last edited by karldmoore; Aug 29th, 2007, 10:04 AM.

            Comment

            Working...
            X