-
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
Comsos Provider EntityEntry.ReloadAsync Non-Functional #18710
Comments
Note to implementor: the |
Is there any workaround I could use for handling optimistic concurrency? |
@alexeymarkov You could try running a no-tracking query to get the database values and then apply these values to the already tracked entity. |
@ajcvickers I ended up with the solution
I'm not sure it will work for all cases but it works for me where I change a navigation property, try to call SaveChangesAsync, it fails and I need to reload the entity. If there is a better workaround let me know (with a code snippet if possible). BTW: for failed to save navigation properties I do not get DbUpdateConcurrencyException but CosmosException which seems to be a bug. |
We also need #17670 to be able to fully support this |
I made a workaround just around over a year ago where if you comment out the contents of |
If option 2 is good enough for a PR, I can make it fairly trivially. |
@TheFanatr That would fix this particular issue, but it might also make other queries that use non-persisted properties like the one in #17670 appear to work, though they would return incorrect results. We would accept a PR where you filter out just |
@AndriySvyryd I will work on that then. I have the second option I suggested earlier fully implemented, type mapping and all, so this shouldn’t be too difficult. |
I meant filtering it out in the expression visitors. We definitely need the __jObject property to still exist |
I finished this a long time ago, but never got around to creating a pull request because the branch I am working in contains a lot of other fixes, and I really do not want to have to separate them out. This includes a fix for #15289, as well as a host of other issues I ran into, as well as support for entity members of type |
@TheFanatr Mixing fixes will make the PR process longer. I'd recommend separating them out as we'll stop accepting external PRs for 5.0 at some point this month. |
August 25th is effectively the last day for an external PR to be merged |
Ok, I'll have them in before then. A recent commit broke the indexer use translation, but I fixed it. Will separate them out now; individual branches for #18710 and #15289, and another the use of dictionaries and collections as children of entities as well as the translation of indexer uses on said children. |
What branch do I base these on? release/5.0 is the default, but this is labelled with consider-for-next-release. |
Will do release/5.0 for now. |
…ject property.
Using the
Microsoft.EntityFrameworkCore.Cosmos
nightly alpha of the master branch at5.0.0-alpha1.19551.4
results in a bug when reloading data viaEntityEntry.ReloadAsync
. The following exception is thrown.Steps to reproduce
Database Context
Models
Console Program Class
Further technical details
Version:
5.0.0-alpha1.19551.4
Provider:
Microsoft.EntityFrameworkCore.Cosmos
Target: .NET Core
5.0.100-alpha1-015521
Operating System: Microsoft Windows 1903 Build 18362.418
Development Environment: Visual Studio 2019 Community 16.3.7
The text was updated successfully, but these errors were encountered: