This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, While developing an application, it may require many interrations of modification and when I modify an entity, currently, I'll have to restart the application to start testing from the beginning. Let say, an entity read-in from db and modified in memory but not saved to DB yet. Is there way to revert an entity to its initial read-in state? This will save quite a bit of time developing an application and useful for basic Undo feature. Thanks. -chris |
|
|
Hi Chris, No not currently however this type of feature has been previously requested and is fairly high up our list of features to look at implementing. Currently you will need to flush your identity map (which will remove the cached copy of the entity) and then reload the entity from the database.
|
|
|
Hi, Jeremy, What I would like is per entity flush but if I flush the identity map, I'll have to reload the entire entities, correct? BTW, how do I flush identiy map? I could not find it in the documentation. Thanks. -chris |
|
|
Hi, Jeremy, What I would like is per entity flush but if I flush the identity map, I'll have to reload the entire entities, correct? BTW, how do I flush identiy map? I could not find it in the documentation. Thanks. -chris |
|
|
Hi, I'm still looking for flushing indentity map. It could be simply calling an API, anyone knows? Thanks. -chris. |
|
|
At the moment the only way to flush the identity map is to call |
|
|
By the way, a partial solution to the revert issue is to use the IEditableObject methods. If you call Entity.BeginEdit(), we checkpoint the entity state, and you can subsequently call CancelEdit() to revert to the last checkpoint. If you checkpoint the entity immediately after load, then CancelEdit() will revert it all the way back to the original. Of course, if you are already using BeginEdit/CancelEdit/EndEdit to perform individual edits then this won't work because calls don't nest -- BeginEdit overwrites any existing checkpoint. |
|
|
Hi, Ivan, Great! It's little cumbersome but I can use it as a workaround. Thanks -chris |
|