473,385 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Transaction Rollback and Object State

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.

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

Please advise.

Thanks

-AM-
Nov 4 '08 #1
4 3658
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.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.

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

Please advise.

Thanks

-AM-
Nov 5 '08 #2
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" <ra********@yahoo.comwrote in message
news:00**********************************@a17g2000 prm.googlegroups.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.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.

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

Please advise.

Thanks

-AM-

Nov 5 '08 #3
On Nov 5, 10:48*am, "Aamir Mahmood" <aamirmahm...@gmail.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...@yahoo.comwrote in message

news:00**********************************@a17g2000 prm.googlegroups.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
Nov 6 '08 #4
On Nov 6, 1:46*pm, raylopez99 <raylope...@yahoo.comwrote:
On Nov 5, 10:48*am, "Aamir Mahmood" <aamirmahm...@gmail.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...@yahoo.comwrote in message
news:00**********************************@a17g2000 prm.googlegroups.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.
Nov 6 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mark Vuksani | last post by:
Hi, I have a trigger like this (simplified to illustrate the problem): -------- CREATE TRIGGER Test ON . FOR INSERT, UPDATE, DELETE AS RAISERROR( 'test trigger error !', 16, 1)
1
by: Avanish Pandey | last post by:
Hello All We have 3 differen services (in 3 different server) Service A,B,C . We want to implement distributed transaction when call methods of B and C from A. Is it possible? if yes then how? ...
2
by: Robin Tucker | last post by:
I have a query batch "update" script that upgrades my users database from, say version 0 to version 1, or from version 1 to version 2. I would like to know how I can wrap the entire script in a...
4
by: Rahul Anand | last post by:
Getting SQL Exception when trying to implement Connection based Trasaction using SQL Helper class. I am using the follwing function to execute my stored procs: -=-=-=- ExecuteScalar(ByVal...
2
by: Richard | last post by:
Hi, I have 1 dataset with 2 tables (Table1 as parent, Table2 as Child), 1 row in both the tables. I am updating it with a transaction. First parent then child. When child update fails, it raise...
4
by: graphicsxp | last post by:
Hello, I've got a few stored procedure called made within one sqlTransaction object. If the .Rollback() method of the transaction is called, then I would like some extra code to be executed....
1
by: Matik | last post by:
Hi to all, Probably I'm just doing something stupid, but I would like you to tell me that (if it is so), and point the solution. There ist the thing: I' having a sp, where I call other sp...
3
by: GoogleEyeJoe | last post by:
Dear ladies and gents, I'm trying to determine whether the .NET Framework implements a means of transactional processing without the need for a database. Essentially, I'd like to enlist...
0
ADezii
by: ADezii | last post by:
In the Tip of the Week #19, we demonstrated Transaction Processing, specifically as it applies to DAO (Data Access Objects). In this week's Tip, we'll illustrate how Transaction Processing can be...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.