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 guys, Is there a way to force an entity to mark itself as changed and thus increment the LockVersion concurrency field? I'm looking at easy ways of achieving the following:
(Essentially looking at optimistic concurrency trees and detecting if an entity or any of its children has changed). I could do this via changing a dummy field on the parent item, but was hoping to avoid this. (Note, I'm dealing with disconnected DTOs). Cheers, Mark |
|
|
No, there's no way to do that, except by the obvious kludge of changing some random field and then changing it back again. On the plus side, you might be able to use the metadata API to encapsulate the said kludge -- I'm thinking use the metadata API to select the first non-association, non-ID field, update its value and then update it back again.
This snippet doesn't handle cases such as value objects and inheritance, but I hope it's enough to get you started if you want to explore this route. Another approach is of course to perform the 'have the children changed' check directly by comparing the current children against the children in the database, though I'm not sure whether it's feasible to do this in a way that avoids race conditions. |
|