{"record":{"id":"ceb11654385ac5bd","repo":"dotnet/efcore","slug":"entitytype1-property1-and-entitytype2-pr-ceb116","errorCode":null,"errorMessage":"'{entityType1}.{property1}' and '{entityType2}.{property2}' are both mapped to column '{columnName}' in '{table}', but have different concurrency token configurations.","messagePattern":"'(.+?)\\.(.+?)' and '(.+?)\\.(.+?)' are both mapped to column '(.+?)' in '(.+?)', but have different concurrency token configurations\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/EFCore.Relational/Infrastructure/RelationalModelValidator.cs","lineNumber":1620,"sourceCode":"        var currentScale = property.GetScale(storeObject);\n        var previousScale = duplicateProperty.GetScale(storeObject);\n        if (currentScale != previousScale)\n        {\n            throw new InvalidOperationException(\n                RelationalStrings.DuplicateColumnNameScaleMismatch(\n                    duplicateProperty.DeclaringType.DisplayName(),\n                    duplicateProperty.Name,\n                    property.DeclaringType.DisplayName(),\n                    property.Name,\n                    columnName,\n                    storeObject.DisplayName(),\n                    currentScale,\n                    previousScale));\n        }\n\n        if (property.IsConcurrencyToken != duplicateProperty.IsConcurrencyToken)\n        {\n            throw new InvalidOperationException(\n                RelationalStrings.DuplicateColumnNameConcurrencyTokenMismatch(\n                    duplicateProperty.DeclaringType.DisplayName(),\n                    duplicateProperty.Name,\n                    property.DeclaringType.DisplayName(),\n                    property.Name,\n                    columnName,\n                    storeObject.DisplayName()));\n        }\n\n        var currentTypeString = property.GetColumnType(storeObject);\n        var previousTypeString = duplicateProperty.GetColumnType(storeObject);\n        if (!string.Equals(currentTypeString, previousTypeString, StringComparison.OrdinalIgnoreCase))\n        {\n            throw new InvalidOperationException(\n                RelationalStrings.DuplicateColumnNameDataTypeMismatch(\n                    duplicateProperty.DeclaringType.DisplayName(),\n                    duplicateProperty.Name,\n                    property.DeclaringType.DisplayName(),","sourceCodeStart":1602,"sourceCodeEnd":1638,"githubUrl":"https://github.com/dotnet/efcore/blob/dbf9771522148d61a2467854921bd5dc6f6e6916/src/EFCore.Relational/Infrastructure/RelationalModelValidator.cs#L1602-L1638","documentation":"Two properties sharing a column disagree on the IsConcurrencyToken setting (one acts as a row-version token, the other does not). EF Core needs the column's concurrency role to be unambiguous because it affects UPDATE/DELETE WHERE clauses. Thrown from ValidateCompatible.","triggerScenarios":"A same-named property on sibling TPH types where one uses IsConcurrencyToken() (or [Timestamp]/IsRowVersion) and the other does not; an owned type whose shared column is a token on one side only; table splitting where only one entity treats the column as a token.","commonSituations":"Adding optimistic concurrency to one entity in a hierarchy but forgetting the sibling that shares the column; migrating from byte[] RowVersion to uint32 with Xmin where one side forgot to mark the token; misusing [Timestamp] on a shared column.","solutions":["Mark both properties as concurrency tokens (or neither) consistently.","If only one entity needs the token, rename it to a distinct column via HasColumnName.","Move the entity that needs the token to its own table."],"exampleFix":"// before\nmodelBuilder.Entity<Student>().Property(s => s.Version).IsRowVersion();\nmodelBuilder.Entity<Teacher>().Property(t => t.Version);\n// after\nmodelBuilder.Entity<Student>().Property(s => s.Version).IsRowVersion();\nmodelBuilder.Entity<Teacher>().Property(t => t.Version).IsRowVersion();","handlingStrategy":"validation","validationCode":"using (var ctx = new MyContext()) { ctx.Model.ToDebugString(); }\nvar a = ctx.Model.FindEntityType(typeof(Student))!.FindProperty(\"Version\")!.IsConcurrencyToken;\nvar b = ctx.Model.FindEntityType(typeof(Teacher))!.FindProperty(\"Version\")!.IsConcurrencyToken;\nDebug.Assert(a == b, $\"Concurrency-token mismatch: {a} vs {b}\");","typeGuard":null,"tryCatchPattern":"try { using var ctx = new MyContext(); _ = ctx.Model; }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"concurrency token configurations\"))\n{ log.Error(\"Concurrency-token mismatch on shared column: {Msg}\", ex.Message); throw; }","preventionTips":["Place IsRowVersion()/IsConcurrencyToken() on a shared base property when sibling types share the table.","Run a model-build test at startup to detect token divergence.","When splitting tables, decide on a single owner of the row-version column."],"tags":["ef-core","model-validation","concurrency-token","optimistic-concurrency","shared-table"],"analyzedSha":"dbf9771522148d61a2467854921bd5dc6f6e6916","analyzedAt":"2026-08-06T20:46:03.226Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}