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
|
Greetings. A few months ago you helped me immensely to get started with LightSpeed using Oracle. Now I have a SQLServer 2008 database I am using with LigthSpeed. I am able to select the data just fine, but I am unable to update. I have tried both IdentityColumn and KeyTable IdentityMethods. When I add a attach a context logger, actually nothing is being sent to the database during the SaveChanges() command. I do see the changed data inside a typed list...but it just does not get updated. I hope you may be able to help me. I have a simple model with 3 tables which is updated from the database. When I select Update from source, I receive a message that the entities are all up to date. Thank you kindly! Agraha, Seattle |
|
|
If nothing is being sent to the database, it means we think nothing has been changed or added in the unit of work. The IdentityMethod won't make a difference to this, nor will it be a schema issue. It's hard to guess at what might be wrong without seeing the code, but offhand, I can think of two possibilities: 1. Nothing has been added to the unit of work (e.g. you've inadvertently failed to call IUnitOfWork.Add), or you're saving the wrong unit of work (could happen if you're hiding UOW creation and destruction inside a Repository class and the Repository has faulty lifecycle behaviour). 2. There is a known bug where if you add a new entity to a collection, then remove it again before saving, then *all* entities in that collection get removed from the unit of work and will not be saved. Could that be happening in your case? If you are on LightSpeed 3, you may be able to get additional diagnostics by dumping the contents of the unit of work at various points to see whether things are being added and if so when they are going away. To do this use code such as: foreach (Entity e in unitOfWork) |
|