Giter VIP home page Giter VIP logo

Comments (3)

skyesx avatar skyesx commented on June 11, 2024

这是一个业务问题,框架只负责补偿操作成功执行。

如果你想要通过补偿 回滚的内容 会由于被其他操作修改过而无法正确补偿的话,那么它就不是一个可补偿的业务场景。考虑调整业务以允许补偿,或者考虑调整成TCC

from easytransaction.

wjyheropk avatar wjyheropk commented on June 11, 2024

除了查询以外,大多数涉及到增删改的操作都有这个问题吧
个人理解:除非服务端实现版本控制(补偿操作时,发现要回滚的内容已经被修改,那就报错,人工处理),否则补偿型事务是有问题的

from easytransaction.

skyesx avatar skyesx commented on June 11, 2024

框架肯定是不知道,也没办法知道 你的业务记录有没有被修改。

然后,框架保证的是你的 补偿方法只被执行一遍,如果没有成功执行(抛出乐观锁等异常)那么框架会重试执行

所以当你的补偿业务程序遇到这些乐观锁之类的问题时,直接抛异常就可以了

from easytransaction.

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.