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! Attached is (unfortunately a rather complicated) test-case which manifests a problem in LightSpeed where a removed Entity is not completely removed from all EntityCollections/ThroughAssociations where it is referenced. When UnitOfWork.SaveChanges is called, we get a database constraint error due to this. Could you please have a look at this? Thank you! Björn Andersson |
|
|
Hi Bjorn, I have had a look at this and unfortunately I do not think it is going to be a quick fix. It appears to be related to a broader issue about how we handle associations and the removal of new entities (see http://www.mindscape.co.nz/forums/Thread.aspx?PostID=2968 if you're really interested!). The interim workaround is to remove the new item from the ThroughAssociation rather than from the unit of work, e.g. before doing the unitOfWork.Remove(tableF), do useTableD.TableFList.Remove(tableF). We appreciate that this isn't tremendously convenient but we hope it will be viable for you until we are able to address the underlying issue. |
|
|
Hello again Bjorn, I got JB to look at it and he found a fix after all. This will be available in nightly builds dated 31 Jan 2009 and above, available from the store after about 1430 GMT. I've not had chance to test JB's changes against your original repro code, only against the internal test case we extracted from it, so please let us know if the issue remains in your more complex environment. |
|
|
Hi Ivan! Thank you very much! I will try it out after the weekend then! Best regards Björn Andersson |
|
|
Hi again! I downloaded the latest nightly build and tested against my test case. Unfortunately, the problem only changed shape, but it did not disappear. If you take a look at the attached test case I have made some more comments and explanations to what happens and what is expected to happen. In short, in the previous version of LightSpeed, it didn't remove the ThroughAssociation when it was expected to, but this time, it seems to remove all new items in the ThroughAssociation list, even if only one of them should actually be removed. Best regards Björn Andersson
|
|
|
Hi Bjorn, Thanks for the nice test case, I have identified where this is occuring and we will look at getting this fixed up shortly and released through the nightlies. Will ping you back once we have this in a nightly which you can grab :)
Jeremy |
|
|
Hi Bjorn, We have added a fix for this and it is now available in the nightlies (from 20090210 forward) - can you grab an updated version and let us know how this goes for you?
Thanks! Jeremy |
|
|
Hi! It seem to be working! Thanks! /Björn |
|