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, I have a question regarding lightspeed support for database data changes made by a third party (that is, outside of the current unitOfWork - possibly from another process / program). I've looked through the docs/forum and haven't really found anything. Are there any built in methods for synchronizing data? Something along the lines of unitOfWork.MyEntities.SynchronizeWithDb - which then goes and fires appropriate events for things changing / being added / deleted. Clearly we can write something like this ourselves - but it is always nicer/faster to have it done in the framework :) I would have thought this was a really useful (and not that hard to implement!?) bit of functionality? or have I just missed something? cheers, Ben |
|
|
This is not currently possible except by doing a SaveChanges(true) (which resets the unit of work). It is a frequently requested feature and it is on the backlog. The reason it's non-trivial is due to the handling of associations e.g. if you have added children to an entity and then resync that entity should we throw away the newly added children? Should we try to detect what children have been added and removed in the DB and try to sync-merge the collections? It's not clear what the "correct" behaviour is and some of the options could lead to quite complex synchronisation code. I'll bump the priority of this -- keep chasing us! |
|