Giter VIP home page Giter VIP logo

Comments (12)

chenlong12 avatar chenlong12 commented on June 14, 2024

不行的

from tcc-transaction.

DanielLetha avatar DanielLetha commented on June 14, 2024

可是那如果针对这种不支持XA的事务的数据库来说。想要实现类似tcc这样实时性较高的分布式事务,有什么其他方案呢。是不是要使用基于JTA事务的机制

from tcc-transaction.

chenlong12 avatar chenlong12 commented on June 14, 2024

XA主要是实现了预提交的功能,完后再修改数据的状态。不支持XA的数据,那就需要允许脏读了

from tcc-transaction.

changmingxie avatar changmingxie commented on June 14, 2024

@DanielLetha 不需要。TransactionXid仅仅是生成事务id,和数据库没有关系。TCC-TRANSACTION是一个框架,不关心业务方法里是使用何种数据存储的。

from tcc-transaction.

DanielLetha avatar DanielLetha commented on June 14, 2024

@changmingxie 谢谢。我昨天看到你写的代码是使用Xid所以才有疑问,今天自己再想了下,其实和XA没有关系。另外我这里测试你的demo的时候有个疑问,冒昧说的hug吧。就是我用order在下单完成后去支付,在capital这边我打了断点,故意让程序进入confirm方法,但是在cofirm方法中等待超过服务调用设置的超时时间,这样来测试在这种情况下的事务变化以及order和capital的事务处理机制。我发现当进入confirm后,order和capital都识别到程序执行进去了confirm代码段,尽管在confirm内部执行超时,但是order的状态任然是confirm了。虽然capital的账户一开始也发展了扣款变化,但是一会之后就恢复回来了,反而order的状态依然是confirm,没有变成failed。我就有两个疑问:1、在上述情况下,是不是没有机制去恢复order的状态?2、针对capital的扣款恢复是如何完成的?(我并没有看到有走到capital的cancel代码段)

from tcc-transaction.

chenlong12 avatar chenlong12 commented on June 14, 2024

你调用的时候程序没报异常吗,我这里有点问题哦

from tcc-transaction.

DanielLetha avatar DanielLetha commented on June 14, 2024

@chenlong12 有异常啊。不过看是什么异常,我这边出异常是对的啊。应该抛出异常的

from tcc-transaction.

chenlong12 avatar chenlong12 commented on June 14, 2024

不会报[sample-dubbo-capital]2016-09-29 17:36:33,226 ERROR [TransactionManager] compensable transaction confirm failed.
org.mengyun.tcctransaction.SystemException: java.lang.reflect.InvocationTargetException

from tcc-transaction.

changmingxie avatar changmingxie commented on June 14, 2024

@DanielLetha 在confirm后是不会变成failed的,会一直重试着confirm(默认30次)。你说的capital 帐户又恢复了,照理是不应该的,我回头看下。

from tcc-transaction.

DanielLetha avatar DanielLetha commented on June 14, 2024

@changmingxie 虽然逻辑上confirm后,order的状态应该不会变为failed,但是业务上是需要失败的。capital账户恢复是发生了的。

from tcc-transaction.

DanielLetha avatar DanielLetha commented on June 14, 2024

@chenlong12 没有遇到你的那个确认错误的问题哈。

from tcc-transaction.

changmingxie avatar changmingxie commented on June 14, 2024

@DanielLetha 之前sample写的不够完善。可以看看最新的代码~

from tcc-transaction.

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.