GithubHelp home page GithubHelp logo

Comments (1)

filiphr avatar filiphr commented on July 25, 2024

This works as designed.

What you have explained is valid optimistic lock that makes sure that Flowable stays in a consistent state. There is nothing wrong in the DbSqlSession since it is never been accessed concurrently from different threads.

The reason why you are seeing the optimistic locking exception is due to the fact that the second step is going to actually try and delete the "Share Task", this will trigger a deletion of the execution for the "NotCancelActivity" execution. However, in step 1 the "NotCancelActivity" will actually be deleted since it will be executed.

When the execution happens in the same time both threads are going to read REV_=1 for the "NotCancelActivity" execution. Depending on which thread finishes first there would either be an optimistic lock exception on the first or the second step.

If Step 1 finishes first, then in Step 2 when trying to delete "NotCancelActivity" it will try to delete the execution with the appropriate id and revision 1. However, that execution no longer exists and thus an optimistic lock exception is thrown.

If Step 2 finishes first, then in Steps when trying to delete the "Share Task" and its associated "NotCancelActivity" execution, a similar thing happens. There is no execution for "NotCancelActivity" anymore and thus there is an optimistic lock exception.

Since this works as designed we are going to close this. However, feel free what you think should happen and how an optimistic locking exception can be avoided here.

from flowable-engine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.