Comments (12)
不行的
from tcc-transaction.
可是那如果针对这种不支持XA的事务的数据库来说。想要实现类似tcc这样实时性较高的分布式事务,有什么其他方案呢。是不是要使用基于JTA事务的机制
from tcc-transaction.
XA主要是实现了预提交的功能,完后再修改数据的状态。不支持XA的数据,那就需要允许脏读了
from tcc-transaction.
@DanielLetha 不需要。TransactionXid仅仅是生成事务id,和数据库没有关系。TCC-TRANSACTION是一个框架,不关心业务方法里是使用何种数据存储的。
from tcc-transaction.
@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.
你调用的时候程序没报异常吗,我这里有点问题哦
from tcc-transaction.
@chenlong12 有异常啊。不过看是什么异常,我这边出异常是对的啊。应该抛出异常的
from tcc-transaction.
不会报[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.
@DanielLetha 在confirm后是不会变成failed的,会一直重试着confirm(默认30次)。你说的capital 帐户又恢复了,照理是不应该的,我回头看下。
from tcc-transaction.
@changmingxie 虽然逻辑上confirm后,order的状态应该不会变为failed,但是业务上是需要失败的。capital账户恢复是发生了的。
from tcc-transaction.
@chenlong12 没有遇到你的那个确认错误的问题哈。
from tcc-transaction.
@DanielLetha 之前sample写的不够完善。可以看看最新的代码~
from tcc-transaction.
Related Issues (20)
- 实现动态全局事务管理开关 HOT 1
- 测试出现的2个问题 HOT 1
- tcc-transaction 1.2.12 Dubbo模块,TccInvokerInvocationHandler 设置参数bug HOT 1
- tcc-transaction 1.2.12 api模块,TransactionXid 定制事务编号 HOT 1
- tcc-transaction没看到有与springboot和springcloud生态整合的说明,是不支持吗? HOT 2
- tcc版本1.2.12,duobbo版本2.7.0,主事务到分支事务xid传参错误问题 HOT 6
- 红包金额表和红包订单表都在一个数据库里面,为什么要用分布式事务呢?直接用 spring 支持的@transactional 不行吗? HOT 2
- tcc-http-sample 样例演示购买超链接 抛异常 java.net.SocketTimeoutException: Read timed out HOT 1
- why TradeOrderServiceProxy.record need @Compensable ? HOT 1
- sample中dubbo方式数据库问题 HOT 1
- tcc-transaction分布式事务管理器操作文档 HOT 1
- 如何避免tcc try阶段业务并发重复调用 HOT 2
- 是否支持防悬挂控制 HOT 4
- tcc-transaction 与Dubbo整合后,三层事务方法,底层服务无法confirm或cancel的问题 HOT 3
- 无,看错
- 作者牛逼 HOT 1
- 谁在使用tcc-transaction HOT 1
- 请问如何防止脏读和脏写? HOT 1
- 客户端无法注册naocs HOT 1
- Dependency org.yaml:snakeyaml, leading to CVE problem HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tcc-transaction.