Transaction Rollback and Object State

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aamir Mahmood

    Transaction Rollback and Object State

    Hi

    I am using System.Transact ions.Transactio nScope to implement the
    transactions in my code.

    When the transaction is rolled back because of any reason, I want all the
    objects that were modified in the transaction scope to be in their initial
    (pre-transaction) state.

    Is there something already available in .net? Or some standard approach I
    should follow.

    Please advise.

    Thanks

    -AM-


  • raylopez99

    #2
    Re: Transaction Rollback and Object State

    From memory, I thought this was built into the database engines. You
    just switch on a parameter...you might want to ask in a database
    group.

    Aamir Mahmood wrote:
    Hi
    >
    I am using System.Transact ions.Transactio nScope to implement the
    transactions in my code.
    >
    When the transaction is rolled back because of any reason, I want all the
    objects that were modified in the transaction scope to be in their initial
    (pre-transaction) state.
    >
    Is there something already available in .net? Or some standard approach I
    should follow.
    >
    Please advise.
    >
    Thanks
    >
    -AM-

    Comment

    • Aamir Mahmood

      #3
      Re: Transaction Rollback and Object State

      May be i did not make my point completely clear.
      By 'objects modified during the scope of transaction' i meant, the .net
      objects. The object instances of my own classes.

      Anyway, I am going to raise this post in another group.

      Thanks for your reply.

      -AM-

      "raylopez99 " <raylopez99@yah oo.comwrote in message
      news:001e9f5d-1590-4ffa-b2b2-4d0f16e1d444@a1 7g2000prm.googl egroups.com...
      From memory, I thought this was built into the database engines. You
      just switch on a parameter...you might want to ask in a database
      group.
      >
      Aamir Mahmood wrote:
      >Hi
      >>
      >I am using System.Transact ions.Transactio nScope to implement the
      >transactions in my code.
      >>
      >When the transaction is rolled back because of any reason, I want all the
      >objects that were modified in the transaction scope to be in their
      >initial
      >(pre-transaction) state.
      >>
      >Is there something already available in .net? Or some standard approach
      >I
      >should follow.
      >>
      >Please advise.
      >>
      >Thanks
      >>
      >-AM-

      Comment

      • raylopez99

        #4
        Re: Transaction Rollback and Object State

        On Nov 5, 10:48 am, "Aamir Mahmood" <aamirmahm...@g mail.comwrote:
        May be i did not make my point completely clear.
        By 'objects modified during the scope of transaction' i meant, the .net
        objects.  The object instances of my own classes.
        >
        Anyway, I am going to raise this post in another group.
        >
        Thanks for your reply.
        >
        -AM-
        >
        "raylopez99 " <raylope...@yah oo.comwrote in message
        >
        news:001e9f5d-1590-4ffa-b2b2-4d0f16e1d444@a1 7g2000prm.googl egroups.com...
        >
        From memory, I thought this was built into the database engines.  You
        just switch on a parameter...you might want to ask in a database
        group.
        >
        Aamir Mahmood wrote:
        Hi

        Good luck. You might want to look into the so-called "memento" design
        object. Once I had to do a "snapshot" of a state of my objects in C#,
        and I used a book by Judith Bishop which is a take off of the Gang of
        Four famous book on design patterns for C#, to do a so-called memento
        design pattern which allowed me to take snapshots of my objects
        state. Worked fine for me, but it's hard to explain by email. Better
        to have Bishop's book before you. C# does not allow "read only"
        objects so it's a bit trickier than for other languages, but you can
        figure it out easily enough if you study it.

        RL

        Comment

        • G.S.

          #5
          Re: Transaction Rollback and Object State

          On Nov 6, 1:46 pm, raylopez99 <raylope...@yah oo.comwrote:
          On Nov 5, 10:48 am, "Aamir Mahmood" <aamirmahm...@g mail.comwrote:
          >
          >
          >
          >
          >
          May be i did not make my point completely clear.
          By 'objects modified during the scope of transaction' i meant, the .net
          objects.  The object instances of my own classes.
          >
          Anyway, I am going to raise this post in another group.
          >
          Thanks for your reply.
          >
          -AM-
          >
          "raylopez99 " <raylope...@yah oo.comwrote in message
          >
          news:001e9f5d-1590-4ffa-b2b2-4d0f16e1d444@a1 7g2000prm.googl egroups.com....
          >
          From memory, I thought this was built into the database engines.  You
          just switch on a parameter...you might want to ask in a database
          group.
          >
          Aamir Mahmood wrote:
          >Hi
          >
          Good luck.  You might want to look into the so-called "memento" design
          object.  Once I had to do a "snapshot" of a state of my objects in C#,
          and I used a book by Judith Bishop which is a take off of the Gang of
          Four famous book on design patterns for C#, to do a so-called memento
          design pattern which allowed me to take snapshots of my objects
          state.  Worked fine for me, but it's hard to explain by email.  Better
          to have Bishop's book before you.  C# does not allow "read only"
          objects so it's a bit trickier than for other languages, but you can
          figure it out easily enough if you study it.
          >
          RL- Hide quoted text -
          >
          - Show quoted text -
          Rockford Lhotka's CSLA framework gives you a good foundation taht you
          can at least use as a frame of refference if you decide to implement
          this yourself.

          Comment

          Working...