You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After migrating from version 5.1.3 to version 8.3.2, we are experimenting many concurrency control errors in our production environment (due to higher load).
We noticed that when we retrieve an entity from database with IRepository... and its related data from the database (.Incude), saving the entity causes all the related entities retrieved from the database to also be modified (checked with LastModification property). Since all of them have the "concurrency stamp" attribute, they are competing for priority when saving to the database.
99% of our entities has FullAuditedAggregateRoot inherits.
Before exception we find a several warnings logs, like:
Message: There is an entry which is not saved due to concurrency exception: Deposit {Id: 3} Modified
Security Level: Warning
After warning log, an exception has been thrown:
The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See https://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions. The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See https://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions.
Reproduction Steps
IQueryable<ActivityReport> query = await this.ActivityReportRepository.GetQueryableAsync();
IQueryable<ActivityReport> query = query
.Include(x => x.OriginDeposit)
.Include(x => x.DestinationDeposit)
.Where(x => x.State == ActivityReportState.Finished);
var report = await query.FirstOrDefaultAsync();
report.Number = 1234;
await this.ActivityReportRepository.UpdateAsync(report);
// After saving, our Origin and Destination desposits has been updated and "LastModificationTime", "LastModifierId"
// was refreshed and new ConcurrencyStamp was generated in Deposits entities.
Expected behavior
No response
Actual behavior
No response
Regression?
No response
Known Workarounds
No response
Version
8.3.2
User Interface
Angular
Database Provider
EF Core (Default)
Tiered or separate authentication server
None (Default)
Operation System
Linux
Other information
No response
The text was updated successfully, but these errors were encountered:
We create two examples, with diferents parent classes , Dogs-Owners (FullAuditedEntity) and Order-Location (FullAuditedAggregateRoot)
Please verify database records after requests, you can see the LastModificationTime changes.
We made comments above de updates methods in the appservices (DogAppService and LocationAppService)
Example: https://we.tl/t-QWXLaDpJ4o
Maybe this "bug" has been introduced after this issue here, #18701 ? Because our team create severals solution downgrading version by version and before 8.2.0 doesn't happens and the PR of 18707 was merged to 8.2.0....
Another mistake, we found if we add an optional parameter to repository.UpdateAsync(entity, **true**), the behavior (reported above) doesn't occur.
We are planning to downgrade our production version to 8.1.5 or inspect our solution (isn't small) and add missing autosave parameters and set it true...
Is there an existing issue for this?
Description
After migrating from version 5.1.3 to version 8.3.2, we are experimenting many concurrency control errors in our production environment (due to higher load).
We noticed that when we retrieve an entity from database with IRepository... and its related data from the database (.Incude), saving the entity causes all the related entities retrieved from the database to also be modified (checked with LastModification property). Since all of them have the "concurrency stamp" attribute, they are competing for priority when saving to the database.
99% of our entities has FullAuditedAggregateRoot inherits.
Before exception we find a several warnings logs, like:
Message: There is an entry which is not saved due to concurrency exception: Deposit {Id: 3} Modified
Security Level: Warning
After warning log, an exception has been thrown:
The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See https://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions. The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See https://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions.
Reproduction Steps
Expected behavior
No response
Actual behavior
No response
Regression?
No response
Known Workarounds
No response
Version
8.3.2
User Interface
Angular
Database Provider
EF Core (Default)
Tiered or separate authentication server
None (Default)
Operation System
Linux
Other information
No response
The text was updated successfully, but these errors were encountered: