Having problems with BeginEdit/ApplyEdit/Save on BO

Having problems with BeginEdit/ApplyEdit/Save on BO

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


Harry posted on Friday, February 10, 2012

I call BeginEdit  on my BO before the user edits it.  I can call BO.CancelEdit() and the edits are cancelled as expected and the BO state is restore.  If I want to save the changes made by the user I am called BO.ApplyEdit(); Followed by BO =BO.Save();

The ApplyEdits() sets the BO.IsSelfBusy to true causing the Save to fail.

 

Any pointers to what I'm doing wrong would be appreciated.

JonnyBee replied on Monday, February 13, 2012

When the object is busy typically some async operation is running - like async business rules.

It may also be caused by non-compliant async business rules that do not call context.Complete(). All async rules must make sure to call context.Complete in all execution paths to signal to the rule engine that rule is completed and object is no longer busy.

Please check if the object has IsSelfBusy already set before you call ApplyEdit.

Copyright (c) Marimer LLC