Open luoyonghui55 opened 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());
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(
; 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:
; 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 com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:106) ~[dubbo-2.6.5.jar:2.6.5]
... 23 common frames omitted
多次提交同一个commodityCode 模拟多个用户同时购买同一个商品, 全部报io.seata.rm.datasource.exec.LockConflictException , 看锁是t_storage:1 库存表的id为1的行, 即请求商品库存, 请问怎么加大这个锁的大小,或者改成等待
在示例中,扣减仓库(当仓库不存在数据时)数量时报错: 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×tamp=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×tamp=1560405720554&version=1.0.0, invoke elapsed 8458 ms., dubbo version: 2.6.5, current host: 192.168.136.1