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

Concurrency tokens with table-splitting and TPC throws #29751

Closed
ajcvickers opened this issue Dec 3, 2022 · 1 comment
Closed

Concurrency tokens with table-splitting and TPC throws #29751

ajcvickers opened this issue Dec 3, 2022 · 1 comment
Labels
area-save-changes closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@ajcvickers
Copy link
Member

See tests in #29730.

Note that it appears to work when the dependent type is owned.

System.InvalidOperationException: The property 'CityTpc.Name' cannot be assigned a value generated by the database. Store-generated values can only be...

System.InvalidOperationException
The property 'CityTpc.Name' cannot be assigned a value generated by the database. Store-generated values can only be assigned to properties configured to use store-generated values.
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetStoreGeneratedValue(IProperty property, Object value, Boolean setModified) in C:\github\efcore\src\EFCore\ChangeTracking\Internal\InternalEntityEntry.cs:line 794
   at Microsoft.EntityFrameworkCore.Update.ModificationCommand.ColumnValuePropagator.TryPropagate(IColumnMappingBase mapping, IUpdateEntry entry) in C:\github\efcore\src\EFCore.Relational\Update\ModificationCommand.cs:line 984
   at Microsoft.EntityFrameworkCore.Update.ModificationCommand.<GenerateColumnModifications>g__HandleColumnModification|41_5(IColumnMappingBase columnMapping, <>c__DisplayClass41_0&, <>c__DisplayClass41_1&, <>c__DisplayClass41_2&) in C:\github\efcore\src\EFCore.Relational\Update\ModificationCommand.cs:line 550
   at Microsoft.EntityFrameworkCore.Update.ModificationCommand.GenerateColumnModifications() in C:\github\efcore\src\EFCore.Relational\Update\ModificationCommand.cs:line 407
   at Microsoft.EntityFrameworkCore.Update.ModificationCommand.<>c.<get_ColumnModifications>b__33_0(ModificationCommand command) in C:\github\efcore\src\EFCore.Relational\Update\ModificationCommand.cs:line 101
   at Microsoft.EntityFrameworkCore.Internal.NonCapturingLazyInitializer.EnsureInitialized[TParam,TValue](TValue& target, TParam param, Func`2 valueFactory) in C:\github\efcore\src\Shared\NonCapturingLazyInitializer.cs:line 27
   at Microsoft.EntityFrameworkCore.Update.ModificationCommand.get_ColumnModifications() in C:\github\efcore\src\EFCore.Relational\Update\ModificationCommand.cs:line 100
   at Microsoft.EntityFrameworkCore.Update.Internal.CommandBatchPreparer.CreateCommandBatches(IEnumerable`1 commandSet, Boolean moreCommandSets, Boolean assertColumnModification, ParameterNameGenerator parameterNameGenerator)+MoveNext() in C:\github\efcore\src\EFCore.Relational\Update\Internal\CommandBatchPreparer.cs:line 119
   at Microsoft.EntityFrameworkCore.Update.Internal.CommandBatchPreparer.BatchCommands(IList`1 entries, IUpdateAdapter updateAdapter)+MoveNext() in C:\github\efcore\src\EFCore.Relational\Update\Internal\CommandBatchPreparer.cs:line 78
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) in C:\github\efcore\src\EFCore.Relational\Update\Internal\BatchExecutor.cs:line 165
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken) in C:\github\efcore\src\EFCore\ChangeTracking\Internal\StateManager.cs:line 1226
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) in C:\github\efcore\src\EFCore\ChangeTracking\Internal\StateManager.cs:line 1325
   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) in C:\github\efcore\src\EFCore\Storage\ExecutionStrategy.cs:line 304
   at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) in C:\github\efcore\src\EFCore\DbContext.cs:line 771
   at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) in C:\github\efcore\src\EFCore\DbContext.cs:line 808
   at Microsoft.EntityFrameworkCore.OptimisticConcurrencySqlServerTestBase`2.<>c__DisplayClass3_0`3.<<Row_version_with_table_splitting>b__0>d.MoveNext() in C:\github\efcore\test\EFCore.SqlServer.FunctionalTests\OptimisticConcurrencySqlServerTest.cs:line 261
--- End of stack trace from previous location ---
   at Microsoft.EntityFrameworkCore.OptimisticConcurrencySqlServerTestBase`2.<>c__DisplayClass3_0`3.<<Row_version_with_table_splitting>b__0>d.MoveNext() in C:\github\efcore\test\EFCore.SqlServer.FunctionalTests\OptimisticConcurrencySqlServerTest.cs:line 285
--- End of stack trace from previous location ---
   at Microsoft.EntityFrameworkCore.OptimisticConcurrencySqlServerTestBase`2.<>c__DisplayClass3_0`3.<<Row_version_with_table_splitting>b__0>d.MoveNext() in C:\github\efcore\test\EFCore.SqlServer.FunctionalTests\OptimisticConcurrencySqlServerTest.cs:line 285
--- End of stack trace from previous location ---
   at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c__7`1.<<ExecuteAsync>b__7_0>d.MoveNext() in C:\github\efcore\src\EFCore\Storage\ExecutionStrategyExtensions.cs:line 238
--- End of stack trace from previous location ---
   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<<ExecuteAsync>b__0>d.MoveNext() in C:\github\efcore\src\EFCore\Storage\ExecutionStrategy.cs:line 311
--- End of stack trace from previous location ---
   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) in C:\github\efcore\src\EFCore\Storage\ExecutionStrategy.cs:line 334
   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) in C:\github\efcore\src\EFCore\Storage\ExecutionStrategy.cs:line 358
   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) in C:\github\efcore\src\EFCore\Storage\ExecutionStrategy.cs:line 310
   at Microsoft.EntityFrameworkCore.OptimisticConcurrencySqlServerTestBase`2.Row_version_with_table_splitting[TEntity,TCity,TVersion](Boolean updateDependent, Mapping mapping, String propertyName) in C:\github\efcore\test\EFCore.SqlServer.FunctionalTests\OptimisticConcurrencySqlServerTest.cs:line 217
   at Microsoft.EntityFrameworkCore.OptimisticConcurrencySqlServerTestBase`2.Row_version_with_table_splitting[TEntity,TCity,TVersion](Boolean updateDependent, Mapping mapping, String propertyName) in C:\github\efcore\test\EFCore.SqlServer.FunctionalTests\OptimisticConcurrencySqlServerTest.cs:line 217
   at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass48_0.<<InvokeTestMethodAsync>b__1>d.MoveNext() in /_/src/xunit.execution/Sdk/Frameworks/Runners/TestInvoker.cs:line 264
--- End of stack trace from previous location ---
   at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) in /_/src/xunit.execution/Sdk/Frameworks/ExecutionTimer.cs:line 48
   at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) in /_/src/xunit.core/Sdk/ExceptionAggregator.cs:line 90
@AndriySvyryd AndriySvyryd self-assigned this Dec 5, 2022
@ajcvickers ajcvickers added this to the Backlog milestone Dec 8, 2022
AndriySvyryd added a commit that referenced this issue Aug 5, 2023
AndriySvyryd added a commit that referenced this issue Aug 6, 2023
AndriySvyryd added a commit that referenced this issue Aug 6, 2023
AndriySvyryd added a commit that referenced this issue Aug 7, 2023
@AndriySvyryd AndriySvyryd added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Aug 7, 2023
@AndriySvyryd
Copy link
Member

Fixed by 11bced2

@AndriySvyryd AndriySvyryd modified the milestones: Backlog, 8.0.0 Aug 7, 2023
@AndriySvyryd AndriySvyryd removed their assignment Aug 7, 2023
@ajcvickers ajcvickers modified the milestones: 8.0.0, 8.0.0-rc1 Aug 19, 2023
@ajcvickers ajcvickers modified the milestones: 8.0.0-rc1, 8.0.0 Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-save-changes 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

2 participants