Open Closed

related Properties has updated with no changes when save main object - AbpDbConcurrencyException - ConcurrencyStamp and LastModificationTime #8611


User avatar
0
cmonzon created

A few days ago I created a github issue because our team detects severals errors in production environment (concurrency)

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.

We think this is a bug introduced in version 8.2.0 because if an object is modified, its related classes should not be marked as modified when they have not been modified.

https://github.com/abpframework/abp/issues/21835

Today we execute a downgrade of nugets package version to 8.1.5 and ALL exceptions of type AbpDbConcurrencyException disappeared.

  • ABP Framework version: v8.3.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): N/A
  • Steps to reproduce the issue: create Location, Create order, update order using swagger (project was uploaded to github issue using wetransfer)

2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I will check your project asap.

    Thanks.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    In your current relationship between Order and Location.

    Order is Dependent (child) and Location is Principal (parent)

    When Order(child) changed. ABP will think Location (parent) needs to be updated.

    You can try to change the Location (parent). In this case, Order(child) will not change.

    See https://learn.microsoft.com/en-us/ef/core/modeling/relationships/one-to-one#required-one-to-one

Made with ❤️ on ABP v9.2.0-preview. Updated on January 08, 2025, 14:09