Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null ref when attempting to back propagate non-existent results #4347

Closed
anpete opened this issue Jan 20, 2016 · 0 comments
Closed

Null ref when attempting to back propagate non-existent results #4347

anpete opened this issue Jan 20, 2016 · 0 comments
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@anpete
Copy link
Contributor

anpete commented Jan 20, 2016

Entity key is configured for IDENTITY but database is misconfigured to not have IDENTITY on the column.

Microsoft.Data.Entity.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Data.Entity.ChangeTracking.Internal.Snapshot`2.set_Item(Int32 index, Object value)
   at Microsoft.Data.Entity.ChangeTracking.Internal.InternalEntityEntry.SetOriginalValue(IPropertyBase propertyBase, Object value)
   at Microsoft.Data.Entity.ChangeTracking.Internal.InternalEntityEntry.SetPropertyModified(IProperty property, Boolean isModified)
   at Microsoft.Data.Entity.ChangeTracking.Internal.ChangeDetector.PropertyChanged(InternalEntityEntry entry, IPropertyBase propertyBase)
   at Microsoft.Data.Entity.ChangeTracking.Internal.InternalEntityEntryNotifier.Dispatch(Action`1 action)
   at Microsoft.Data.Entity.Update.ModificationCommand.PropagateResults(ValueBuffer valueBuffer)
   at Microsoft.Data.Entity.Update.AffectedCountModificationCommandBatch.ConsumeResultSetWithPropagation(Int32 commandIndex, DbDataReader reader)
   at Microsoft.Data.Entity.Update.AffectedCountModificationCommandBatch.Consume(DbDataReader reader)
   --- End of inner exception stack trace ---
   at Microsoft.Data.Entity.Update.AffectedCountModificationCommandBatch.Consume(DbDataReader reader)
   at Microsoft.Data.Entity.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
   at Microsoft.Data.Entity.Update.Internal.BatchExecutor.Execute(IEnumerable`1 commandBatches, IRelationalConnection connection)
   at Microsoft.Data.Entity.ChangeTracking.Internal.StateManager.SaveChanges(IReadOnlyList`1 entriesToSave)
   at Microsoft.Data.Entity.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess)
   at Microsoft.Data.Entity.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess)
   at Benchmarks.Data.ApplicationDbSeeder.Seed(ApplicationDbContext db) in C:\Dev\github\aspnet\benchmarks\src\Benchmarks\Data\ApplicationDbSeeder.cs:line 39
@rowanmiller rowanmiller added this to the 1.0.0 milestone Feb 1, 2016
ajcvickers added a commit that referenced this issue Apr 28, 2016
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 15, 2022
@ajcvickers ajcvickers removed their assignment Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

3 participants