-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Throw on saving partial changes to entities using shared tables with concurrency token #14154
Comments
Related to #12865 |
I thought about this some more and then we discussed in triage; we decided not to do this. :-) Thought process: If multiple (non-owned) entities are mapped to the same table, and that table has a concurrency column, then:
@AndriySvyryd Does this make sense? |
@ajcvickers Sure, but we would need to do something to make this work: |
@AndriySvyryd Presumably you mean for auto-updating concurrency tokens, like |
Linking to #1985 since while this in-of-itself is not about aggregates, it is closely related to table splitting with owned types. |
We need to make sure that this works correctly if the concurrency token is mapped to both entities. |
Decision for 3.0: We will throw (model validation) if a concurrency token that is store generated (i.e. rowversion pattern) is not mapped to all entities that share a table. |
Propagate modified values to all properties sharing a column. Validate that the store generated concurrency token is mapped to all entity types sharing the table. Set owned type table name using the default value provider instead of a convention Don't mark the discriminator as read-only Fixes #14154
Propagate modified values to all properties sharing a column. Validate that the store generated concurrency token is mapped to all entity types sharing the table. Set owned type table name using the default value provider instead of a convention Don't mark the discriminator as read-only Fixes #14154
Propagate modified values to all properties sharing a column. Validate that the store generated concurrency token is mapped to all entity types sharing the table. Set owned type table name using the default value provider instead of a convention Don't mark the discriminator as read-only Fixes #14154 Fixes #12758 Fixes #12865 Fixes #14539
Propagate modified values to all properties sharing a column. Validate that the store generated concurrency token is mapped to all entity types sharing the table. Set owned type table name using the default value provider instead of a convention Don't mark the discriminator as read-only Fixes #14154 Fixes #12758 Fixes #12865 Fixes #14539
Propagate modified values to all properties sharing a column. Validate that the store generated concurrency token is mapped to all entity types sharing the table. Set owned type table name using the default value provider instead of a convention Don't mark the discriminator as read-only Fixes #14154 Fixes #12758 Fixes #12865 Fixes #14539
Why don't you just add it silently as a shadow state mapped property to all entities in the graph mapped to the target? You know which other entities there are in the graph mapped onto the same target, you know if the entities in that graph map or don't map the concurrency token field explicitly or through shadow state... (graph mapped onto the target is the set of entities related to each other and owning one another, like the order -orderdetails example in the docs) Now the user has to explicitly do this manually while all the info to do this for the user is in the model at runtime. |
We felt that if the properties were created by convention then it would be less obvious how to deal with concurrency issues on those types. |
:) |
@FransBouma I agree, that's why I filed #18063 to do that and add documentation. |
Cool thanks! :) |
If there's a concurrency token column in a table then the entity containing it should be tracked when saving changes to any entities sharing the table, otherwise an exception would be thrown.
The text was updated successfully, but these errors were encountered: