MarkOld & Transaction rollback

MarkOld & Transaction rollback

Old forum URL: forums.lhotka.net/forums/t/4214.aspx


RalphTime posted on Tuesday, January 22, 2008

Since it is the responsibility of child objects to call MarkOld in there update and/or insert routines, what happens to the IsNew & IsDirty properties if the transaction is rolled back? In other words,  if the parent transaction is rolled back after one of the children has successfully executed its insert or update, and would have therefore called "MarkOld", the database action is rolled back but what about the state of  IsNew = false and IsDirty = false on the children that were updated prior to the error?

Just curious,

Thanks in advance!

Ralph

 

amselem replied on Wednesday, January 23, 2008

Normally you save a clone of the object, not the original. If save fails you can discard the clone and keep the original.

In Csla 2.x you do this manually, in Csla 3.0 you can set the config setting "CslaAutoCloneOnUpdate" to do it automatically. I think that in Csla 3.5 this setting defaults to True.

Copyright (c) Marimer LLC