Open Closed

Concurrency Stamp Issue After Upgrading from ABP 8.2 to 9.0 #8398


User avatar
0
rushas created

We upgraded our project from ABP 8.2 to 9.0, but methods that were previously working now give the error: 'The data you have submitted has already been changed by another user. Discard your changes and try again.' However, when we revert to the old project, we do not encounter this error. It seems that a change in the concurrency stamp structure after the update is causing an issue in our system. We need your support on this matter.

  • ABP Framework version: v9.0.0
  • UI Type: MVC
  • Database System: EF Core SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

3 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi,

    Check this link https://github.com/abpframework/abp/issues/18114 if it is helpful for you.

    Thank you.

  • User Avatar
    0
    rushas created

    Hi,

    Thank you for your response. After making the following change to the code, my system started working as it did before:

    For example, I had a method in the Application layer like this:

    [UnitOfWork]
    public async Task<SomethingDto> SomethingMethod() { ... }
    
    

    This method worked fine in version 8.2. However, after upgrading to .NET 9.0, it stopped working. (Error: 'The data you have submitted has already been changed by another user. Discard your changes and try again.')

    I applied the solution you suggested:

    public async Task<SomethingDto> SomethingMethod() {
        using (var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional: true)) {
            ...
            await uow.CompleteAsync();
        }
    }
    

    After implementing this change, the method works correctly again. I didn't make any other changes to the main block of the method.

    What do you think could be the reason for this behavior?

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello ,

    Can you please check this similar issue https://abp.io/support/questions/8122/Concurrency-issue

    Thank you.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 12, 2024, 07:15