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
An error issue when using both ToJson() and UpdateMany() methods or manually enabled multiple UnitOfWorks #19635
Comments
Applications often make errors after a recent upgrade to.NET 8, I found that if I used tojson() to map jsonb fields, I encountered this problem when I manually enabled multiple UnitOfWorks, and I didn't encounter this problem when I fell back on the tojson() method to HasColumnType("jsonb"). Also note that I made an http request in the UnitOfWork: Npgsql.NpgsqlException: Exception while writing to stream When this error occurs, the database fails to log the error log most of the time, Occasionally, however, the following errors are recorded: And this problem seems to exist only in certain scenarios, for example, I run it perfectly in debug mode on my macbook, but I run it 3-4 times out of 10 on ubuntu pgsql: 14 |
hi This doesn't seem to be related to abp. If you can reproduce this problem with some code or a simple project, Please share them, Thanks. |
Is there an existing issue for this?
Description
When there is a jsonb field on the data table and it is mapped using ToJson(), and the jsonb field has not been modified. using the UpdateMany() method will result in an error:
System.InvalidOperationException: The value of shadow key property 'ProduceTrackingCuttingRequire.Id' is unknown when attempting to save changes. This is because shadow property values cannot be preserved when the entity is not being tracked. Consider adding the property to the entity's .NET type. See https://aka.ms/efcore-docs-owned-collections for more information.
But when I use the Update() method within a loop, there is no issue.
Reproduction Steps
No response
Expected behavior
No response
Actual behavior
No response
Regression?
No response
Known Workarounds
No response
Version
8.0.5
User Interface
Angular
Database Provider
EF Core (Default)
Tiered or separate authentication server
Tiered
Operation System
Linux
Other information
No response
The text was updated successfully, but these errors were encountered: