StrataFrame Forum

BO.Save, Transaction and EditingState

http://forum.strataframe.net/Topic21426.aspx

By Chan - 1/7/2009

Hi,

I am developing web application. In one of my web page, I bind my PrimaryBO to it. When user click a button, I call the PrimaryBO.Save() and then some other BOs.Save() as well. They are within Transaction, try...catch block.



If that is any exception caused by some other BOs.Save() which called after PrinmaryBO.Save(), I call BusinessLayer.TransactionRollback().



I have problem that, even though is rollbacked, PrimaryBO.EditingState() will still Idle. It caused user unable to "re-edit" it on UI. How to solve this?



Thank you
By Chan - 1/8/2009

Hi,

Any advice? It is urgent!



Thank you
By Trent L. Taylor - 1/12/2009

The only way that this would happen when calling the Save of a BO directly is if there is a relationship setup between multiple BOs.  For example, if you have a foreign key setup and the ParentBusinessObject is set on the child BO, when the child saves, it will check to see if parent needs to save first to gain a real primary key.  In this instance, another BO other than the one you called would get saved as well.  But past that, that should be the only way.