If the @GlobalTransactional is added to the sample code, the following error will be reported. If the @GlobalTransactional annotation is not added, it can be executed normally. What is the reason? // 样例代码中如果加上@GlobalTransactional就报下面的错误,如果不加@GlobalTransactional注解则可以正常执行,请问是啥原因?
2019-01-11 15:57:15,059 [FESCAR] [main] INFO com.alibaba.fescar.tm.dubbo.BusinessService - Main business begin ... xid: null 2019-01-11 15:57:27,709 [FESCAR] [main] DEBUG com.alibaba.fescar.core.rpc.netty.AbstractRpcRemoting - offer message: com.alibaba.fescar.core.protocol.transaction.GlobalBeginRequest@38a6964d 2019-01-11 15:57:57,712 [FESCAR] [main] ERROR com.alibaba.fescar.core.rpc.netty.AbstractRpcRemoting - wait response error:cost 30004 ms,ip:127.0.0.1:8091,request:com.alibaba.fescar.core.protocol.transaction.GlobalBeginRequest@38a6964d 2019-01-11 15:57:57,749 [FESCAR] [main] WARN com.alibaba.fescar.tm.api.DefaultFailureHandlerImpl - Failed to begin transaction. com.alibaba.fescar.core.exception.TransactionException: java.util.concurrent.TimeoutException: cost 30004 ms at com.alibaba.fescar.tm.DefaultTransactionManager.syncCall(DefaultTransactionManager.java:100) at com.alibaba.fescar.tm.DefaultTransactionManager.begin(DefaultTransactionManager.java:65) at com.alibaba.fescar.tm.api.DefaultGlobalTransaction.begin(DefaultGlobalTransaction.java:82) at com.alibaba.fescar.tm.api.TransactionalTemplate.execute(TransactionalTemplate.java:40) at com.alibaba.fescar.spring.annotation.GlobalTransactionalInterceptor.invoke(GlobalTransactionalInterceptor.java:51) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635) at com.alibaba.fescar.tm.dubbo.impl.BusinessServiceImpl$$EnhancerByCGLIB$$e0bc343.purchase() at com.alibaba.fescar.tm.dubbo.impl.BusinessServiceImpl.main(BusinessServiceImpl.java:62) Caused by: java.util.concurrent.TimeoutException: cost 30004 ms at com.alibaba.fescar.core.protocol.MessageFuture.get(MessageFuture.java:46) at com.alibaba.fescar.core.rpc.netty.AbstractRpcRemoting.sendAsyncRequest(AbstractRpcRemoting.java:265) at com.alibaba.fescar.core.rpc.netty.AbstractRpcRemoting.sendAsyncRequestWithResponse(AbstractRpcRemoting.java:194) at com.alibaba.fescar.core.rpc.netty.TmRpcClient.sendMsgWithResponse(TmRpcClient.java:196) at com.alibaba.fescar.core.rpc.netty.TmRpcClient.sendMsgWithResponse(TmRpcClient.java:216) at com.alibaba.fescar.tm.DefaultTransactionManager.syncCall(DefaultTransactionManager.java:98) ... 8 common frames omitted Exception in thread "main" java.lang.reflect.UndeclaredThrowableException at com.alibaba.fescar.tm.dubbo.impl.BusinessServiceImpl$$EnhancerByCGLIB$$e0bc343.purchase() at com.alibaba.fescar.tm.dubbo.impl.BusinessServiceImpl.main(BusinessServiceImpl.java:62) Caused by: com.alibaba.fescar.core.exception.TransactionException: java.util.concurrent.TimeoutException: cost 30004 ms at com.alibaba.fescar.tm.DefaultTransactionManager.syncCall(DefaultTransactionManager.java:100) at com.alibaba.fescar.tm.DefaultTransactionManager.begin(DefaultTransactionManager.java:65) at com.alibaba.fescar.tm.api.DefaultGlobalTransaction.begin(DefaultGlobalTransaction.java:82) at com.alibaba.fescar.tm.api.TransactionalTemplate.execute(TransactionalTemplate.java:40) at com.alibaba.fescar.spring.annotation.GlobalTransactionalInterceptor.invoke(GlobalTransactionalInterceptor.java:51) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635) ... 2 more Caused by: java.util.concurrent.TimeoutException: cost 30004 ms at com.alibaba.fescar.core.protocol.MessageFuture.get(MessageFuture.java:46) at com.alibaba.fescar.core.rpc.netty.AbstractRpcRemoting.sendAsyncRequest(AbstractRpcRemoting.java:265) at com.alibaba.fescar.core.rpc.netty.AbstractRpcRemoting.sendAsyncRequestWithResponse(AbstractRpcRemoting.java:194) at com.alibaba.fescar.core.rpc.netty.TmRpcClient.sendMsgWithResponse(TmRpcClient.java:196) at com.alibaba.fescar.core.rpc.netty.TmRpcClient.sendMsgWithResponse(TmRpcClient.java:216) at com.alibaba.fescar.tm.DefaultTransactionManager.syncCall(DefaultTransactionManager.java:98) ... 8 more
原提问者GitHub用户csfrez c
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。