[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

Transaction Rollback and Object State

Aamir Mahmood

11/5/2008 6:53:00 PM

Hi

I am using System.Transactions.TransactionScope 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.

By 'all the objects' I mean the C# object instances that were modified (any
property, field changed) during the transaction.

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

Please advise.

Thanks

-AM-



1 Answer

Cowboy

11/6/2008 2:35:00 AM

0

The method of handling this in most MS data objects is to hold original
state as well as changed state. You can then rollback to original. The
DataSet is a great example of this. If you want the same capability, you
will have to roll some of your own.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/Greg...

or just read it:
http://feeds.feedburner.com/Gre...

********************************************
| Think outside the box! |
********************************************
"Aamir Mahmood" <aamirmahmood@gmail.com> wrote in message
news:uMfCxe3PJHA.1148@TK2MSFTNGP05.phx.gbl...
> Hi
>
> I am using System.Transactions.TransactionScope 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.
>
> By 'all the objects' I mean the C# object instances that were modified
> (any
> property, field changed) during the transaction.
>
> Is there something already available in .net? Or some standard approach I
> should follow.
>
> Please advise.
>
> Thanks
>
> -AM-
>
>
>