276234199

Results comments of 276234199

调试发现,A的try还没走完 B就已经confirm了 。 A服务控制台提示XXX.XX.XX.XX.serviceImpl is participanting in a non-TCC transaction 使用的是springcloud 2.1.X + tcc0.5.3 应该是A 没有参与全局事务 @Service("orderServiceTryImpl") @Compensable(interfaceClass = OrderService.class, confirmableKey = "orderServiceConfirmImpl", cancellableKey = "orderServiceCancelImpl") public class OrderServiceTryImpl implements...

A服务的controller层如下 @RestController @RequestMapping("/order") public class OrderController { @Autowired @Qualifier("orderServiceTryImpl") OrderService orderService; // http://localhost:12591/order/create @PostMapping("/create") @Transactional public RequestResult createOreder(CreateOrderOptionReqVO orderCondition) throws CustomizeException { // dotoken // doCheck Integer userId = 1;...

大佬你好~ 按照楼上的解决办法修改之后~全局事务应该已经传播出去了 ,但是问题还是存在··· 求大佬花时间看看下面··· 消费方A控制台输出有看到 2019-06-20 15:42:55.533 INFO 8312 --- [io-12591-exec-4] o.b.bytetcc.CompensableManagerImpl : e03f49da4dde56a3eade950620d1e0c9| compensable transaction begin! 2019-06-20 15:42:55.533 INFO 8312 --- [io-12591-exec-4] o.b.bytejta.TransactionCoordinator : e03f49da4dde56a3eade950620d1e0c9> begin-participant 2019-06-20 15:42:55.533 INFO...

调整方式为 将OrderController.createOreder()方法中的@transactional注解删掉 ----------------------------------------------------------------------------------- 消费方A 在try方法中 写了个int i= 1/0 模拟异常 消费方A输出如下 A的confirm中就是打印输出confirm 但是并没有出现 也没有cancel 2019-06-20 15:58:54.259 INFO 8312 --- [io-12591-exec-6] o.b.bytetcc.CompensableManagerImpl : e03f49da4dde56a3fad9830b77439e98| compensable transaction begin! 2019-06-20 15:58:54.259 INFO 8312 ---...

首先感谢大佬 花时间看这个问题 B服务中是有做DB操作的 但是我也没用新启动一个线程 我也看到了日志里的rollback 所以感到奇怪 rollback应该是走cancel的 而不是confirm 其代码如下。 @Compensable(interfaceClass = TCCManageSkuStockService.class, confirmableKey = "confirmLockItemSkuServiceImpl", cancellableKey = "cancelLockItemSkuServiceImpl") @Service("tryLockItemSkuServiceImpl") public class TryLockItemSkuServiceImpl implements TCCManageSkuStockService { @Autowired ItemDAO itemDao; @Autowired SkuDAO...

经检查,是被调用方的controller处加了@HystrixCommand(fallbackMethod = "tryItemSkuFallback")导致的失效,HystrixCommand会新建线程

pom.xml com.github.pagehelper pagehelper-spring-boot-starter 1.2.5 application.yml pagehelper: helperDialect: mysql reasonable: true supportMethodsArguments: true params: count=countSql 哪里没弄对。。?