LateAutumnWindow opened a new issue #10147:
URL: https://github.com/apache/shardingsphere/issues/10147


   POM
   <spring.boot.version>2.2.5.RELEASE</spring.boot.version>
   <spring.cloud.version>Hoxton.SR3</spring.cloud.version>
   <cloud.alibaba.version>2.2.1.RELEASE</cloud.alibaba.version>
   <seata.version>1.2.0</seata.version>
   <shardingsphere.version>4.1.1</shardingsphere.version>
   
----------------------------------------------------------------------------------------------------------------------------------------
   `
   1. Order-Service
   @Override
       @Transactional
       @ShardingTransactionType(TransactionType.BASE)
       public CommonResult createOrder(String userId, String commodityCode, int 
count) {
           System.out.println(RootContext.getXID() + " ==  
===========================================");
   
           // Redisson联锁同时锁住用户ID,和物品Code
           RLock multiLock = RedissonLockUtil.getMultiLock(userId, 
commodityCode);
           try{
               multiLock.lock(30, TimeUnit.SECONDS);
               // 计算价格,扣除库存
               CommonResult goodsPrice = 
storageServerApi.getGoodsPrice(commodityCode, count);
               Integer countMoney = (Integer) goodsPrice.getData();
               Order build = Order.builder()
                       .orderId(idUtil.nextId())
                       .commodityCode(commodityCode)
                       .userId(Integer.parseInt(userId))
                       .count(count)
                       .money(countMoney)
                       .build();
               // 创建运单
               orderMapper.createOrder(build);
               // 账户扣钱
               accountApi.deductMoney(userId, countMoney);
               if (count > 999) {
                   int i = 10 / 0;
               }
           } catch (Exception e) {
               log.info("创建订单失败", e);
               throw new RuntimeException("创建订单失败");
           } finally {
               multiLock.unlock();
           }
           return new CommonResult<>(200, "订单创建成功");
       }
   `
   
----------------------------------------------------------------------------------------------------------------------------------------
   2. Account-Service
   `
    @Override
   @Transactional(rollbackFor = Exception.class)
   @ShardingTransactionType(TransactionType.BASE)
   public CommonResult deductMoney(String userId, Integer money) {
       System.out.println(RootContext.getXID() + " ==  
===========================================");
       Integer moneys = accountMapper.getUserInfo(userId);
       accountMapper.deductMoney(userId, (moneys - money));
       return new CommonResult(200, "扣钱成功");
   }
   `
   
----------------------------------------------------------------------------------------------------------------------------------------
   3. Storage-Service
   `
   @Override
   @Transactional(rollbackFor = Exception.class)
   @ShardingTransactionType(TransactionType.BASE)
   public CommonResult getGoodsPrice(String commodityCode, Integer count) {
       System.out.println(RootContext.getXID() + " ==  
===========================================");
       Storage goods = storageMapper.getGoodsUnitPrice(commodityCode);
       int price = goods.getUnitPrice() * count;
       storageMapper.dwindleNumbers(commodityCode, (goods.getCount() - count));
       return new CommonResult<>(200, "计算成功", price);
   }
   `
   ----------------------------------------------- stack 
-----------------------------------------------------------------------------
   order-stack
   xid = 192.168.40.199:8091:2009089507 ==  
===========================================
   2021-04-21 16:43:02.907  INFO 3236 --- [io-2001-exec-10] ShardingSphere-SQL  
                     : Logic SQL: INSERT INTO t_order (
               `user_id`,
               `commodity_code`,
               `count`,
               `money`,
               `order_id`
           )
           VALUES
               ( ?, ?, ?, ?, ?);
   2021-04-21 16:43:02.907  INFO 3236 --- [io-2001-exec-10] ShardingSphere-SQL  
                     : SQLStatement: 
InsertStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement@53bc4cb3,
 
tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@bda9873),
 
tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@bda9873,
 columnNames=[user_id, commodity_code, count, money, order_id], 
insertValueContexts=[InsertValueContext(parametersCount=5, 
valueExpressions=[ParameterMarkerExpressionSegment(startIndex=179, 
stopIndex=179, parameterMarkerIndex=0), 
ParameterMarkerExpressionSegment(startIndex=182, stopIndex=182, 
parameterMarkerIndex=1), ParameterMarkerExpressionSegment(startIndex=185, 
stopIndex=185, parameterMarkerIndex=2), 
ParameterMarkerExpressionSegment(startIndex=188, stopIndex=188, 
parameterMarkerIndex=3), ParameterMarkerExpressionSegment(startIndex=1
 91, stopIndex=191, parameterMarkerIndex=4)], parameters=[1002, A12E12, 299999, 
2999990, 582287327590748160])], 
generatedKeyContext=Optional[GeneratedKeyContext(columnName=order_id, 
generated=false, generatedValues=[582287327590748160])])
   2021-04-21 16:43:02.907  INFO 3236 --- [io-2001-exec-10] ShardingSphere-SQL  
                     : Actual SQL: ds0 ::: INSERT INTO t_order_0 (
               `user_id`,
               `commodity_code`,
               `count`,
               `money`,
               `order_id`
           )
           VALUES
               (?, ?, ?, ?, ?); ::: [1002, A12E12, 299999, 2999990, 
582287327590748160]
   2021-04-21 16:43:02.912  WARN 3236 --- [io-2001-exec-10] 
i.s.rm.datasource.exec.InsertExecutor    : Fail to get auto-generated keys, use 
'SELECT LAST_INSERT_ID()' instead. Be cautious, statement could be polluted. 
Recommend you set the statement to return generated keys.
   2021-04-21 16:43:03.024  INFO 3236 --- [168.40.199_8848] 
c.a.n.client.config.impl.ClientWorker    : get changedGroupKeys:[]
   2021-04-21 16:43:03.066  INFO 3236 --- [io-2001-exec-10] 
c.y.cloud.service.impl.OrderServiceImpl  : 创建订单失败
   
   java.lang.ArithmeticException: / by zero
        at 
com.yan.cloud.service.impl.OrderServiceImpl.createOrder(OrderServiceImpl.java:61)
 ~[classes/:na]
        at 
com.yan.cloud.service.impl.OrderServiceImpl$$FastClassBySpringCGLIB$$d646290e.invoke(<generated>)
 [classes/:na]
        at 
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) 
[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:769)
 [spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
 [spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
 [spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
 ~[spring-tx-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:99)
 ~[spring-tx-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
 [spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
 [spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.apache.shardingsphere.transaction.spring.ShardingTransactionTypeInterceptor.invoke(ShardingTransactionTypeInterceptor.java:41)
 ~[sharding-transaction-spring-4.1.1.jar:4.1.1]
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
 [spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
 [spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
 ~[spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
com.yan.cloud.service.impl.OrderServiceImpl$$EnhancerBySpringCGLIB$$9b3db72f.createOrder(<generated>)
 ~[classes/:na]
        at 
com.yan.cloud.controller.OrderController.createOrder(OrderController.java:29) 
~[classes/:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[na:1.8.0_171]
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[na:1.8.0_171]
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[na:1.8.0_171]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
        at 
org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282) 
~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.cloud.context.scope.GenericScope$LockedScopedProxyFactoryBean.invoke(GenericScope.java:499)
 ~[spring-cloud-context-2.2.2.RELEASE.jar:2.2.2.RELEASE]
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
 [spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
 [spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
 ~[spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
com.yan.cloud.controller.OrderController$$EnhancerBySpringCGLIB$$383f5311.createOrder(<generated>)
 ~[classes/:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[na:1.8.0_171]
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[na:1.8.0_171]
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[na:1.8.0_171]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
        at 
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) 
~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) 
~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) 
~[tomcat-embed-websocket-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:109)
 ~[spring-boot-actuator-2.2.5.RELEASE.jar:2.2.5.RELEASE]
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) 
~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) 
~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) 
~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367) 
~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1639)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) 
~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
~[na:1.8.0_171]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
~[na:1.8.0_171]
        at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_171]
   
   2021-04-21 16:43:03.082  INFO 3236 --- [atch_RMROLE_1_8] 
i.s.core.rpc.netty.RmMessageListener     : 
onMessage:xid=192.168.40.199:8091:2009089507,branchId=2009089515,branchType=AT,resourceId=jdbc:mysql://192.168.40.199:3316/ds0,applicationData=null
   2021-04-21 16:43:03.083  INFO 3236 --- [atch_RMROLE_1_8] 
io.seata.rm.AbstractRMHandler            : Branch Rollbacking: 
192.168.40.199:8091:2009089507 2009089515 jdbc:mysql://192.168.40.199:3316/ds0
   2021-04-21 16:43:03.091  INFO 3236 --- [atch_RMROLE_1_8] 
i.s.r.d.undo.AbstractUndoLogManager      : xid 192.168.40.199:8091:2009089507 
branch 2009089515, undo_log deleted with GlobalFinished
   2021-04-21 16:43:03.092  INFO 3236 --- [atch_RMROLE_1_8] 
io.seata.rm.AbstractRMHandler            : Branch Rollbacked result: 
PhaseTwo_Rollbacked
   2021-04-21 16:43:03.112  INFO 3236 --- [io-2001-exec-10] 
i.seata.tm.api.DefaultGlobalTransaction  : [192.168.40.199:8091:2009089507] 
rollback status: Rollbacked
   2021-04-21 16:43:03.115 ERROR 3236 --- [io-2001-exec-10] 
o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet 
[dispatcherServlet] in context with path [] threw exception [Request processing 
failed; nested exception is java.lang.RuntimeException: 创建订单失败] with root cause
   
   java.lang.RuntimeException: 创建订单失败
        at 
com.yan.cloud.service.impl.OrderServiceImpl.createOrder(OrderServiceImpl.java:65)
 ~[classes/:na]
        at 
com.yan.cloud.service.impl.OrderServiceImpl$$FastClassBySpringCGLIB$$d646290e.invoke(<generated>)
 ~[classes/:na]
        at 
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) 
~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:769)
 ~[spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
 ~[spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
 ~[spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
 ~[spring-tx-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:99)
 ~[spring-tx-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
 ~[spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
 ~[spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.apache.shardingsphere.transaction.spring.ShardingTransactionTypeInterceptor.invoke(ShardingTransactionTypeInterceptor.java:41)
 ~[sharding-transaction-spring-4.1.1.jar:4.1.1]
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
 ~[spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
 ~[spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
 ~[spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
com.yan.cloud.service.impl.OrderServiceImpl$$EnhancerBySpringCGLIB$$9b3db72f.createOrder(<generated>)
 ~[classes/:na]
        at 
com.yan.cloud.controller.OrderController.createOrder(OrderController.java:29) 
~[classes/:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[na:1.8.0_171]
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[na:1.8.0_171]
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[na:1.8.0_171]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
        at 
org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282) 
~[spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.cloud.context.scope.GenericScope$LockedScopedProxyFactoryBean.invoke(GenericScope.java:499)
 ~[spring-cloud-context-2.2.2.RELEASE.jar:2.2.2.RELEASE]
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
 ~[spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
 ~[spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
 ~[spring-aop-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
com.yan.cloud.controller.OrderController$$EnhancerBySpringCGLIB$$383f5311.createOrder(<generated>)
 ~[classes/:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[na:1.8.0_171]
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[na:1.8.0_171]
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[na:1.8.0_171]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
        at 
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) 
~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
 ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) 
~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) 
~[tomcat-embed-websocket-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:109)
 ~[spring-boot-actuator-2.2.5.RELEASE.jar:2.2.5.RELEASE]
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
 ~[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
 [tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
 [tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) 
[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) 
[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
 [tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) 
[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367) 
[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
 [tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
 [tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1639)
 [tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) 
[tomcat-embed-core-9.0.31.jar:9.0.31]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
[na:1.8.0_171]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
[na:1.8.0_171]
        at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 [tomcat-embed-core-9.0.31.jar:9.0.31]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_171]
   
   
   
----------------------------------------------------------------------------------------------------------------------------------
   
   storage-stack
   
   xid = 192.168.40.199:8091:2009089508 ==  
===========================================
   2021-04-21 16:43:02.749  INFO 15448 --- [nio-2011-exec-1] ShardingSphere-SQL 
                      : Logic SQL: SELECT
               stor.unit_price,
               stor.count
           FROM storage_0 stor
           WHERE stor.commodity_code = ?
   2021-04-21 16:43:02.749  INFO 15448 --- [nio-2011-exec-1] ShardingSphere-SQL 
                      : SQLStatement: 
SelectStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.SelectStatement@57e69caf,
 
tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@6ab1b449),
 
tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@6ab1b449,
 projectionsContext=ProjectionsContext(startIndex=19, stopIndex=57, 
distinctRow=false, projections=[ColumnProjection(owner=stor, name=unit_price, 
alias=Optional.empty), ColumnProjection(owner=stor, name=count, 
alias=Optional.empty)]), 
groupByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.groupby.GroupByContext@15a0dba8,
 
orderByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.orderby.OrderByContext@5b119840,
 
paginationContext=org.apache.shardingsphere.sql.parser.binder.segment.select.pagination.Pa
 ginationContext@6deaa90e, containsSubquery=false)
   2021-04-21 16:43:02.750  INFO 15448 --- [nio-2011-exec-1] ShardingSphere-SQL 
                      : Actual SQL: ds1 ::: SELECT
               stor.unit_price,
               stor.count
           FROM storage_0 stor
           WHERE stor.commodity_code = ? ::: [A12E12]
   2021-04-21 16:43:02.753  INFO 15448 --- [nio-2011-exec-1] ShardingSphere-SQL 
                      : Logic SQL: UPDATE storage_0 st
           SET st.count = ?
           WHERE
               st.commodity_code = ?
   2021-04-21 16:43:02.753  INFO 15448 --- [nio-2011-exec-1] ShardingSphere-SQL 
                      : SQLStatement: 
UpdateStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.UpdateStatement@af1c01e,
 
tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@4e74f490),
 
tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@4e74f490)
   2021-04-21 16:43:02.754  INFO 15448 --- [nio-2011-exec-1] ShardingSphere-SQL 
                      : Actual SQL: ds0 ::: UPDATE storage_0 st
           SET st.count = ?
           WHERE
               st.commodity_code = ? ::: [-299001, A12E12]
   2021-04-21 16:43:02.754  INFO 15448 --- [nio-2011-exec-1] ShardingSphere-SQL 
                      : Actual SQL: ds1 ::: UPDATE storage_0 st
           SET st.count = ?
           WHERE
               st.commodity_code = ? ::: [-299001, A12E12]
   2021-04-21 16:43:02.899  INFO 15448 --- [nio-2011-exec-1] 
i.seata.tm.api.DefaultGlobalTransaction  : [192.168.40.199:8091:2009089508] 
commit status: Committed
   2021-04-21 16:43:03.224  INFO 15448 --- [atch_RMROLE_1_8] 
i.s.core.rpc.netty.RmMessageListener     : 
onMessage:xid=192.168.40.199:8091:2009089508,branchId=2009089510,branchType=AT,resourceId=jdbc:mysql://192.168.40.199:3316/ds1,applicationData=null
   2021-04-21 16:43:03.224  INFO 15448 --- [atch_RMROLE_1_8] 
io.seata.rm.AbstractRMHandler            : Branch committing: 
192.168.40.199:8091:2009089508 2009089510 jdbc:mysql://192.168.40.199:3316/ds1 
null
   2021-04-21 16:43:03.224  INFO 15448 --- [atch_RMROLE_1_8] 
io.seata.rm.AbstractRMHandler            : Branch commit result: 
PhaseTwo_Committed
   2021-04-21 16:43:03.251  INFO 15448 --- [atch_RMROLE_1_8] 
i.s.core.rpc.netty.RmMessageListener     : 
onMessage:xid=192.168.40.199:8091:2009089508,branchId=2009089512,branchType=AT,resourceId=jdbc:mysql://192.168.40.199:3316/ds0,applicationData=null
   2021-04-21 16:43:03.252  INFO 15448 --- [atch_RMROLE_1_8] 
io.seata.rm.AbstractRMHandler            : Branch committing: 
192.168.40.199:8091:2009089508 2009089512 jdbc:mysql://192.168.40.199:3316/ds0 
null
   2021-04-21 16:43:03.252  INFO 15448 --- [atch_RMROLE_1_8] 
io.seata.rm.AbstractRMHandler            : Branch commit result: 
PhaseTwo_Committed
   
   
   
   
----------------------------------------------------------------------------------------------------------------------
   account-stack
   
   xid = 192.168.40.199:8091:2009089516 ==  
===========================================
   2021-04-21 16:43:02.974  INFO 12144 --- [nio-2021-exec-3] ShardingSphere-SQL 
                      : Logic SQL: select
             acc.money
           from account_0 acc
           where acc.user_id = ?
   2021-04-21 16:43:02.974  INFO 12144 --- [nio-2021-exec-3] ShardingSphere-SQL 
                      : SQLStatement: 
SelectStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.SelectStatement@24ded1d2,
 
tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@538ba8ee),
 
tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@538ba8ee,
 projectionsContext=ProjectionsContext(startIndex=17, stopIndex=25, 
distinctRow=false, projections=[ColumnProjection(owner=acc, name=money, 
alias=Optional.empty)]), 
groupByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.groupby.GroupByContext@45953db3,
 
orderByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.orderby.OrderByContext@62129fde,
 
paginationContext=org.apache.shardingsphere.sql.parser.binder.segment.select.pagination.PaginationContext@3de6542b,
 containsSubquery=false)
   2021-04-21 16:43:02.974  INFO 12144 --- [nio-2021-exec-3] ShardingSphere-SQL 
                      : Actual SQL: ds0 ::: select
             acc.money
           from account_0 acc
           where acc.user_id = ? ::: [1002]
   2021-04-21 16:43:02.978  INFO 12144 --- [nio-2021-exec-3] ShardingSphere-SQL 
                      : Logic SQL: UPDATE account_0 acc
           SET acc.money = ?
           WHERE
               acc.user_id = ?
   2021-04-21 16:43:02.978  INFO 12144 --- [nio-2021-exec-3] ShardingSphere-SQL 
                      : SQLStatement: 
UpdateStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.UpdateStatement@3cc289fa,
 
tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@292a1494),
 
tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@292a1494)
   2021-04-21 16:43:02.978  INFO 12144 --- [nio-2021-exec-3] ShardingSphere-SQL 
                      : Actual SQL: ds0 ::: UPDATE account_0 acc
           SET acc.money = ?
           WHERE
               acc.user_id = ? ::: [-2990010, 1002]
   2021-04-21 16:43:02.978  INFO 12144 --- [nio-2021-exec-3] ShardingSphere-SQL 
                      : Actual SQL: ds1 ::: UPDATE account_0 acc
           SET acc.money = ?
           WHERE
               acc.user_id = ? ::: [-2990010, 1002]
   2021-04-21 16:43:03.060  INFO 12144 --- [nio-2021-exec-3] 
i.seata.tm.api.DefaultGlobalTransaction  : [192.168.40.199:8091:2009089516] 
commit status: Committed
   2021-04-21 16:43:03.269  INFO 12144 --- [atch_RMROLE_1_8] 
i.s.core.rpc.netty.RmMessageListener     : 
onMessage:xid=192.168.40.199:8091:2009089516,branchId=2009089518,branchType=AT,resourceId=jdbc:mysql://192.168.40.199:3316/ds0,applicationData=null
   2021-04-21 16:43:03.270  INFO 12144 --- [atch_RMROLE_1_8] 
io.seata.rm.AbstractRMHandler            : Branch committing: 
192.168.40.199:8091:2009089516 2009089518 jdbc:mysql://192.168.40.199:3316/ds0 
null
   2021-04-21 16:43:03.270  INFO 12144 --- [atch_RMROLE_1_8] 
io.seata.rm.AbstractRMHandler            : Branch commit result: 
PhaseTwo_Committed
   2021-04-21 16:43:03.292  INFO 12144 --- [atch_RMROLE_1_8] 
i.s.core.rpc.netty.RmMessageListener     : 
onMessage:xid=192.168.40.199:8091:2009089516,branchId=2009089520,branchType=AT,resourceId=jdbc:mysql://192.168.40.199:3316/ds1,applicationData=null
   2021-04-21 16:43:03.292  INFO 12144 --- [atch_RMROLE_1_8] 
io.seata.rm.AbstractRMHandler            : Branch committing: 
192.168.40.199:8091:2009089516 2009089520 jdbc:mysql://192.168.40.199:3316/ds1 
null
   2021-04-21 16:43:03.292  INFO 12144 --- [atch_RMROLE_1_8] 
io.seata.rm.AbstractRMHandler            : Branch commit result: 
PhaseTwo_Committed


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to