Random database errors

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Good morning.

We are currently developing a 4.0 version of our existing 3.6 site.  When I'm running the site in Visual Studio, I randomly receive database errors.  

Examples:

`The property 'Id' is part of the object's key information and cannot be modified.`

`OptimisticConcurrencyException: Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded.`

I'm not sure what's causing these because they are unpredictable.  Sometimes I'll get one even when I'm not even doing anything or touching anything.  But when they happen, the application stops altogether and I need to hit the start button again.

Any ideas about what's up here?

Thanks!

Jeremy
5 years ago
Did you make custom code changes?
Did you add new entities?
Check to be sure your tables have an "Id" column that is an Identity.
5 years ago
We've made a ton of code changes, but we haven't added any new tables or altered the structure of existing tables.

Jeremy
5 years ago
This is not about adding new tables. This error means you are trying to change the ID of an existing entity, usually during Update. You cannot change ID of an existing entity.


5 years ago
How can I track it down?  Sometimes I'll just be sitting and looking at some code not making any changes and the error will jump out.  I've disabled all scheduled tasks and I haven't seen the error in a few hours, but I don't know if that's success because sometimes many hours pass before I see it again on any other day.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.