|
|
Transactions as Well!
Posted Oct 18, 2004 - 07:42 AM

This next version is truly going to be quite a major upgrade. Ive just finished implementing Transactions within the Framework, so you can now safely call .Save() and can ensure that the database will either be commited with data or Rolled back if there was a validation problem.
Im also trying out an experimental feature which Ive never done before: In Memory transactions. i.e. I keep track of the state of the object by making a copy of it and using that copy if i ever need to rollback. Now this seems like some hair brained idea, since it means twice the amount of memory would be needed to keep track of both modified and unmodified objects. However, Ill continue implementing this, and when and IF we see any performance degradations, it will be just a compile switch away ...
Just to highlight what I mean by In Memory Transactions, check out this NUnit code fragment:
mObj2.MyString = "Two";
mObj2.BeginAtomic();
mObj2.MyString = "Three";
mObj2.BeginAtomic();
mObj2.MyString = "Four";
mObj2.BeginAtomic();
Assert.AreEqual( "Four", mObj2.MyString );
mObj2.RollbackAtomic();
Assert.AreEqual( "Four", mObj2.MyString );
mObj2. RollbackAtomic();
Assert.AreEqual( "Three", mObj2.MyString );
mObj2. RollbackAtomic();
Assert.AreEqual( "Two", mObj2.MyString );
yk.
| |
Login
Related links
|
| Transactions as Well! | Log-in or register a new user account | 0 Comments |
|
| Comments are statements made by the person that posted them. They do not necessarily represent the opinions of the site editor. |
|
Other Stories
· Downtime ... mysql
(Nov 16, 2005)
· Editable Grids, and OnPopulateCell.. Change of param signature
(Sep 11, 2005)
· Right hand Column
(Sep 02, 2005)
· site down....
(Aug 18, 2005)
· More Apps with csopf
(Aug 09, 2005)
· Namespace change for ASP
(Aug 09, 2005)
· Searching with subselects
(Jul 05, 2005)
· Strange Links.
(Jun 16, 2005)
· csopf is listed in the UNDP - International Open Source Network
(Jun 14, 2005)
· All about Enums
(Jun 10, 2005)
Poll
Login
Past Articles
| Friday, June 10 |
| · | Namespace change for UIs. (0) |
| Tuesday, June 07 |
| · | csopf-v0.4.0 is finally out! (0) |
| Monday, June 06 |
| · | csopf works with mono (0) |
| Sunday, June 05 |
| · | Revamp to the csopf Website (0) |
| Sunday, December 05 |
| · | Wot?! No Updates?! (219) |
| Monday, October 18 |
| · | Transactions as Well! (124) |
| Monday, October 11 |
| · | ASP.NET.... working on it! (272) |
| Thursday, September 30 |
| · | .Net Reflection and Performance (127) |
| Wednesday, September 22 |
| · | csopf-v0.3.9 - Major Changes (82) |
| Thursday, September 16 |
| · | Work In Progress for v0.3.9 (256) |
| | Older articles |
|