apache / incubator-seata-samples

Apache Seata(incubating) Samples for Java
https://seata.apache.org/
Apache License 2.0
2.27k stars 1.92k forks source link

子事务提交报错:java.sql.SQLException: io.seata.core.exception.TransactionException #156

Open luoyonghui55 opened 5 years ago

luoyonghui55 commented 5 years ago

在示例中,扣减仓库(当仓库不存在数据时)数量时报错: 2019-06-13 16:13:25.576 INFO 13872 --- [atch_RMROLE_4_8] io.seata.core.rpc.netty.RmRpcClient : RmRpcClient sendResponse xid=192.168.136.1:8091:2014124048,branchId=2014124049,branchStatus=PhaseTwo_Rollbacked,result code =Success,getMsg =null org.springframework.jdbc.UncategorizedSQLException:

Error committing transaction. Cause: java.sql.SQLException: io.seata.core.exception.TransactionException: Response[TransactionException[192.168.136.1:8091:2014124048]]

Cause: java.sql.SQLException: io.seata.core.exception.TransactionException: Response[TransactionException[192.168.136.1:8091:2014124048]]

; uncategorized SQLException; SQL state [null]; error code [0]; io.seata.core.exception.TransactionException: Response[TransactionException[192.168.136.1:8091:2014124048]]; nested exception is java.sql.SQLException: io.seata.core.exception.TransactionException: Response[TransactionException[192.168.136.1:8091:2014124048]] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) at com.sun.proxy.$Proxy79.update(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:294) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) at com.sun.proxy.$Proxy80.decreaseStorage(Unknown Source) at io.seata.samples.integration.storage.service.TStorageServiceImpl.decreaseStorage(TStorageServiceImpl.java:26) at io.seata.samples.integration.storage.service.TStorageServiceImpl$$FastClassBySpringCGLIB$$29699009.invoke() at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684) at io.seata.samples.integration.storage.service.TStorageServiceImpl$$EnhancerBySpringCGLIB$$ae971c20.decreaseStorage() at io.seata.samples.integration.storage.dubbo.StorageDubboServiceImpl.decreaseStorage(StorageDubboServiceImpl.java:28) at com.alibaba.dubbo.common.bytecode.Wrapper1.invokeMethod(Wrapper1.java) at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47) at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:76) at com.alibaba.dubbo.config.invoker.DelegateProviderMetaDataInvoker.invoke(DelegateProviderMetaDataInvoker.java:52) at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56) at io.seata.integration.dubbo.alibaba.TransactionPropagationFilter.invoke(TransactionPropagationFilter.java:61) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:62) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:73) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:138) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:104) at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:96) at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:173) at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51) at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.sql.SQLException: io.seata.core.exception.TransactionException: Response[TransactionException[192.168.136.1:8091:2014124048]] at io.seata.rm.datasource.ConnectionProxy.recognizeLockKeyConflictException(ConnectionProxy.java:130) at io.seata.rm.datasource.ConnectionProxy.processGlobalTransactionCommit(ConnectionProxy.java:179) at io.seata.rm.datasource.ConnectionProxy.commit(ConnectionProxy.java:156) at org.apache.ibatis.transaction.jdbc.JdbcTransaction.commit(JdbcTransaction.java:72) at org.apache.ibatis.executor.BaseExecutor.commit(BaseExecutor.java:244) at org.apache.ibatis.executor.CachingExecutor.commit(CachingExecutor.java:119) at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:224) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:437) ... 42 more Caused by: io.seata.core.exception.TransactionException: Response[TransactionException[192.168.136.1:8091:2014124048]] at io.seata.rm.AbstractResourceManager.branchRegister(AbstractResourceManager.java:68) at io.seata.rm.DefaultResourceManager.branchRegister(DefaultResourceManager.java:96) at io.seata.rm.datasource.ConnectionProxy.register(ConnectionProxy.java:198) at io.seata.rm.datasource.ConnectionProxy.processGlobalTransactionCommit(ConnectionProxy.java:177) ... 48 more 2019-06-13 16:13:26.972 WARN 13872 --- [20882-thread-21] c.a.dubbo.rpc.filter.TimeoutFilter : [DUBBO] invoke time out. method: decreaseStorage arguments: [CommodityDTO(id=null, commodityCode=P190510529590122, name=null, count=2)] , url is dubbo://192.168.136.1:20882/io.seata.samples.integration.common.dubbo.StorageDubboService?anyhost=true&application=dubbo-storage-example&bean.name=ServiceBean:io.seata.samples.integration.common.dubbo.StorageDubboService:1.0.0&bind.ip=192.168.136.1&bind.port=20882&dubbo=2.0.2&generic=false&interface=io.seata.samples.integration.common.dubbo.StorageDubboService&methods=decreaseStorage&pid=13872&qos.enable=false&revision=1.0.0&side=provider&timeout=3000&timestamp=1560405720554&version=1.0.0, invoke elapsed 4436 ms., dubbo version: 2.6.5, current host: 192.168.136.1 2019-06-13 16:13:27.999 WARN 13872 --- [20882-thread-20] c.a.dubbo.rpc.filter.TimeoutFilter : [DUBBO] invoke time out. method: decreaseStorage arguments: [CommodityDTO(id=null, commodityCode=P190510529590122, name=null, count=2)] , url is dubbo://192.168.136.1:20882/io.seata.samples.integration.common.dubbo.StorageDubboService?anyhost=true&application=dubbo-storage-example&bean.name=ServiceBean:io.seata.samples.integration.common.dubbo.StorageDubboService:1.0.0&bind.ip=192.168.136.1&bind.port=20882&dubbo=2.0.2&generic=false&interface=io.seata.samples.integration.common.dubbo.StorageDubboService&methods=decreaseStorage&pid=13872&qos.enable=false&revision=1.0.0&side=provider&timeout=3000&timestamp=1560405720554&version=1.0.0, invoke elapsed 8458 ms., dubbo version: 2.6.5, current host: 192.168.136.1

luoyonghui55 commented 5 years ago

当发送一次请求:http://localhost:8104/business/dubbo/buy JSON参数: { "userId":"1", "commodityCode":"P190510529590122", "name":"fan", "count":2, "amount":"100" } 扣减仓库库存的service(io.seata.samples.integration.storage.service.TStorageServiceImpl)中的 int storage = baseMapper.decreaseStorage(commodityDTO.getCommodityCode(), commodityDTO.getCount());

代码会执行3次,第1次成功,后2次失败,并报错,数据库里的数据也没有变化:

2019-06-13 17:49:49.864 ERROR 7140 --- [20881-thread-15] c.a.dubbo.rpc.filter.ExceptionFilter : [DUBBO] Got unchecked and undeclared exception which called by 192.168.136.1. service: io.seata.samples.integration.common.dubbo.OrderDubboService, method: createOrder, exception: java.lang.reflect.UndeclaredThrowableException: null, dubbo version: 2.6.5, current host: 192.168.136.1

java.lang.reflect.UndeclaredThrowableException: null at com.sun.proxy.$Proxy87.decreaseAccount(Unknown Source) ~[na:na] at io.seata.samples.integration.order.service.TOrderServiceImpl.createOrder(TOrderServiceImpl.java:44) ~[classes/:na] at io.seata.samples.integration.order.service.TOrderServiceImpl$$FastClassBySpringCGLIB$$eddeb9e9.invoke() ~[classes/:na] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684) ~[spring-aop-5.0.8.RELEASE.jar:5.0.8.RELEASE] at io.seata.samples.integration.order.service.TOrderServiceImpl$$EnhancerBySpringCGLIB$$e48b675c.createOrder() ~[classes/:na] at io.seata.samples.integration.order.dubbo.OrderDubboServiceImpl.createOrder(OrderDubboServiceImpl.java:28) ~[classes/:na] at com.alibaba.dubbo.common.bytecode.Wrapper2.invokeMethod(Wrapper2.java) ~[dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47) ~[dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:76) ~[dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.config.invoker.DelegateProviderMetaDataInvoker.invoke(DelegateProviderMetaDataInvoker.java:52) ~[dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56) ~[dubbo-2.6.5.jar:2.6.5] at io.seata.integration.dubbo.alibaba.TransactionPropagationFilter.invoke(TransactionPropagationFilter.java:61) ~[seata-all-0.6.1.jar:0.6.1] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:62) ~[dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:73) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:138) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:104) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:96) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:173) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51) [dubbo-2.6.5.jar:2.6.5] at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57) [dubbo-2.6.5.jar:2.6.5] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_121] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_121] at java.lang.Thread.run(Unknown Source) [na:1.8.0_121] Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_121] at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_121] at com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.invoke(ReferenceAnnotationBeanPostProcessor.java:159) ~[dubbo-2.6.5.jar:2.6.5] ... 38 common frames omitted Caused by: java.lang.RuntimeException: org.springframework.jdbc.UncategorizedSQLException:

Error committing transaction. Cause: java.sql.SQLException: io.seata.core.exception.TransactionException: Response[TransactionException[192.168.136.1:8091:2014124062]]

Cause: java.sql.SQLException: io.seata.core.exception.TransactionException: Response[TransactionException[192.168.136.1:8091:2014124062]]

; uncategorized SQLException; SQL state [null]; error code [0]; io.seata.core.exception.TransactionException: Response[TransactionException[192.168.136.1:8091:2014124062]]; nested exception is java.sql.SQLException: io.seata.core.exception.TransactionException: Response[TransactionException[192.168.136.1:8091:2014124062]] org.springframework.jdbc.UncategorizedSQLException:

Error committing transaction. Cause: java.sql.SQLException: io.seata.core.exception.TransactionException: Response[TransactionException[192.168.136.1:8091:2014124062]]

Cause: java.sql.SQLException: io.seata.core.exception.TransactionException: Response[TransactionException[192.168.136.1:8091:2014124062]]

; uncategorized SQLException; SQL state [null]; error code [0]; io.seata.core.exception.TransactionException: Response[TransactionException[192.168.136.1:8091:2014124062]]; nested exception is java.sql.SQLException: io.seata.core.exception.TransactionException: Response[TransactionException[192.168.136.1:8091:2014124062]] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) at com.sun.proxy.$Proxy79.update(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:294) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) at com.sun.proxy.$Proxy80.decreaseAccount(Unknown Source) at io.seata.samples.integration.account.service.TAccountServiceImpl.decreaseAccount(TAccountServiceImpl.java:24) at io.seata.samples.integration.account.service.TAccountServiceImpl$$FastClassBySpringCGLIB$$43588dc9.invoke() at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684) at io.seata.samples.integration.account.service.TAccountServiceImpl$$EnhancerBySpringCGLIB$$7b307a9c.decreaseAccount() at io.seata.samples.integration.account.dubbo.AccountDubboServiceImpl.decreaseAccount(AccountDubboServiceImpl.java:28) at com.alibaba.dubbo.common.bytecode.Wrapper1.invokeMethod(Wrapper1.java) at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47) at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:76) at com.alibaba.dubbo.config.invoker.DelegateProviderMetaDataInvoker.invoke(DelegateProviderMetaDataInvoker.java:52) at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56) at io.seata.integration.dubbo.alibaba.TransactionPropagationFilter.invoke(TransactionPropagationFilter.java:61) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:62) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:73) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:138) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:104) at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:96) at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:173) at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51) at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.sql.SQLException: io.seata.core.exception.TransactionException: Response[TransactionException[192.168.136.1:8091:2014124062]] at io.seata.rm.datasource.ConnectionProxy.recognizeLockKeyConflictException(ConnectionProxy.java:130) at io.seata.rm.datasource.ConnectionProxy.processGlobalTransactionCommit(ConnectionProxy.java:179) at io.seata.rm.datasource.ConnectionProxy.commit(ConnectionProxy.java:156) at org.apache.ibatis.transaction.jdbc.JdbcTransaction.commit(JdbcTransaction.java:72) at org.apache.ibatis.executor.BaseExecutor.commit(BaseExecutor.java:244) at org.apache.ibatis.executor.CachingExecutor.commit(CachingExecutor.java:119) at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:224) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:437) ... 42 more Caused by: io.seata.core.exception.TransactionException: Response[TransactionException[192.168.136.1:8091:2014124062]] at io.seata.rm.AbstractResourceManager.branchRegister(AbstractResourceManager.java:68) at io.seata.rm.DefaultResourceManager.branchRegister(DefaultResourceManager.java:96) at io.seata.rm.datasource.ConnectionProxy.register(ConnectionProxy.java:198) at io.seata.rm.datasource.ConnectionProxy.processGlobalTransactionCommit(ConnectionProxy.java:177) ... 48 more

at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:106) ~[dubbo-2.6.5.jar:2.6.5]
... 23 common frames omitted
yourchanges commented 5 years ago

多次提交同一个commodityCode 模拟多个用户同时购买同一个商品, 全部报io.seata.rm.datasource.exec.LockConflictException , 看锁是t_storage:1 库存表的id为1的行, 即请求商品库存, 请问怎么加大这个锁的大小,或者改成等待