473,698 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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-
Nov 4 '08 #1
4 3668
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-
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********@yah oo.comwrote in message
news:00******** *************** ***********@a17 g2000prm.google groups.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-

Nov 5 '08 #3
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:00******** *************** ***********@a17 g2000prm.google groups.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...@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:00******** *************** ***********@a17 g2000prm.google groups.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
1894
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
439
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? I have read the doc regarding this: http://www.developer.com/net/asp/article.php/3385631 but it will not work when methods are in different services on
2
7449
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 transaction, so that either the whole thing succeeds or none of it does. For example: BEGIN TRANSACTION ..... ..... Alter some tables
4
5624
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 transaction As SqlTransaction, _ ByVal spName As String, _ ByVal ParamArray parameterValues() As Object)
2
2017
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 an exception, and rollback the parent update. But it also change the rowstate of the parent row from Added to unchanged When you try to save again parent row never get created in database. So child update will fail again. Please suggest what am I...
4
1270
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. The issue is that the .Rollback() method can be called from many different places so I don't want to write this code in all those places. Therefore how can I add an event handler to this method, so that each time it is called, an event is
1
8319
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 inside. The only problem is, the name of this inside sp is builded variously, and executed over sp_executesql:
3
3159
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 light-weight portable business objects within transactions so that that have the ability to roll-back if the client of the object wishes to undo any changes made. For example, if I had a, let's say for sake of simplicity, a person class that had two...
0
17530
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 used within the context of ADO (ActiveX Data Objects). Please refer to the Link below if you wish to see an Overview of Transaction Processing, how it is implemented within DAO, or special issues to be aware of when utilizing Transaction Processing in...
0
8671
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8598
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9152
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8856
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7709
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6515
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2321
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.