java连接Mysql报错介绍

1. Can't call commit when autocommit=true


出现此问题的原因在于,当连接的autocommit是true,即没有开启事物,此时此连接调用conn.commit()时会报错。

java.sql.SQLException: Can't call commit when autocommit=true
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:932)
    at com.mysql.jdbc.ConnectionImpl.commit(ConnectionImpl.java:1743)
    at sun.reflect.GeneratedMethodAccessor494.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
    at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108)
    at org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:81)
    at com.sun.proxy.$Proxy51.commit(Unknown Source)
    at com.zuche.framework.extend.spring.sddl.ShardingConnection.commit(ShardingConnection.java:154)
    at com.zuche.framework.extend.spring.sddl.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:304)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:392)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
    at com.lucky.order.local.core.service.impl.OrderBaseServiceImpl$$EnhancerByCGLIB$$71132628.paymentFromUser()
    at com.lucky.order.remote.core.impl.OrderRemoteServiceImpl$SigleOrderPayExecutor.execute(OrderRemoteServiceImpl.java:428)
    at com.lucky.order.common.util.BaseRemoteService.execute(BaseRemoteService.java:138)
    at com.lucky.order.remote.core.impl.OrderRemoteServiceImpl.paymentOrderFromUser(OrderRemoteServiceImpl.java:396)
    at sun.reflect.GeneratedMethodAccessor709.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.zuche.framework.remote.AbstractRemoteService.invokeWithTransactional(AbstractRemoteService.java:290)
    at com.zuche.framework.remote.AbstractRemoteService.executeServiceNew(AbstractRemoteService.java:116)
    at com.zuche.framework.remote.AbstractRemoteService.executeServiceInvocation(AbstractRemoteService.java:65)
    at com.zuche.framework.remote.AbstractRemoteService$$FastClassByCGLIB$$67d82e8b.invoke()
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at com.zuche.framework.prism.entrypoint.proxy.ServiceRemoteInterceptor.invoke(ServiceRemoteInterceptor.java:99)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
    at com.lucky.order.remote.core.impl.OrderRemoteServiceImpl$$EnhancerByCGLIB$$3dfb1822.executeServiceInvocation()
    at com.zuche.framework.remote.AbstractRemoteService$$FastClassByCGLIB$$67d82e8b.invoke()
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
    at com.lucky.base.common.logcore.aspect.LuckyLogAspect.around(LuckyLogAspect.java:90)
    at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
    at com.lucky.order.remote.core.impl.OrderRemoteServiceImpl$$EnhancerByCGLIB$$482e3e79.executeServiceInvocation()
    at com.zuche.framework.remote.nio.handler.HessianServerHandler.invoke(HessianServerHandler.java:178)
    at com.zuche.framework.remote.nio.handler.HessianServerHandler.messageReceived(HessianServerHandler.java:100)
    at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
    at com.zuche.framework.remote.nio.handler.HessianServerHandler.handleUpstream(HessianServerHandler.java:46)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
    at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:43)
    at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:67)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

2. Could not get JDBC Connection:xxx...Pool empty. Unable to fetch a connection in 10 seconds, none available[size:40; busy:40; idle:0; lastwait:9999]


连接池已经满了,可能原因是访问量过高导致,或者是连接未释放导致

Could not get JDBC Connection; nested exception is org.apache.tomcat.jdbc.pool.PoolExhaustedException: [pool-48-thread-11049] Timeout: Pool empty. Unable to fetch a connection in 10 seconds, none available[size:40; busy:40; idle:0; lastwait:9999]. org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.tomcat.jdbc.pool.PoolExhaustedException: [pool-48-thread-11049] Timeout: Pool empty. Unable to fetch a connection in 10 seconds, none available[size:40; busy:40; idle:0; lastwait:9999].
    at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:83)
    at com.zuche.framework.extend.spring.SqlMapClientTemplateExtend.getConnection(SqlMapClientTemplateExtend.java:841)
    at com.zuche.framework.extend.spring.ProxyConnection.createScanConNoTrans(ProxyConnection.java:155)
    at com.zuche.framework.extend.spring.ProxyConnection.getDataSourceConnection(ProxyConnection.java:95)
    at com.ibatis.sqlmap.engine.transaction.user.UserProvidedTransaction.getConnection(UserProvidedTransaction.java:68)
    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:384)
    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForObject(MappedStatement.java:279)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:535)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:510)
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
    at com.zuche.framework.extend.spring.SqlMapClientTemplateExtend$1.doInSqlMapClient(SqlMapClientTemplateExtend.java:552)
    at com.zuche.framework.extend.spring.SqlMapClientTemplateExtend.execute(SqlMapClientTemplateExtend.java:389)
    at com.zuche.framework.extend.spring.SqlMapClientTemplateExtend.executeWithLogger(SqlMapClientTemplateExtend.java:204)
    at com.zuche.framework.extend.spring.SqlMapClientTemplateExtend.queryForObject(SqlMapClientTemplateExtend.java:550)
    at com.zuche.framework.dao.IbatisDaoImpl.queryForObject(IbatisDaoImpl.java:223)
    at com.lucky.order.local.core.dao.mysql.QueryOrderDetailDao.queryOrderByOrderId(QueryOrderDetailDao.java:45)
    at com.lucky.order.local.core.service.impl.QueryOrderDetailServiceImpl.queryOrderById(QueryOrderDetailServiceImpl.java:93)
    at com.lucky.order.local.core.service.impl.QueryOrderDetailServiceImpl$$FastClassByCGLIB$$46090162.invoke()
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
    at com.lucky.aspect.CacheAspect.cacheResult(CacheAspect.java:108)
    at sun.reflect.GeneratedMethodAccessor306.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
    at com.lucky.order.local.core.service.impl.QueryOrderDetailServiceImpl$$EnhancerByCGLIB$$e81aa10e.queryOrderById()
    at com.lucky.order.remote.core.impl.QueryOrderDetailRemoteServiceImpl.queryOrderByIdLocal(QueryOrderDetailRemoteServiceImpl.java:157)
    at com.lucky.order.remote.core.impl.QueryOrderDetailRemoteServiceImpl.queryChildOrderById(QueryOrderDetailRemoteServiceImpl.java:671)
    at com.lucky.order.remote.core.impl.QueryOrderDetailRemoteServiceImpl.access$1500(QueryOrderDetailRemoteServiceImpl.java:71)
    at com.lucky.order.remote.core.impl.QueryOrderDetailRemoteServiceImpl$17.execute(QueryOrderDetailRemoteServiceImpl.java:479)
    at com.lucky.order.common.util.BaseRemoteService.execute(BaseRemoteService.java:138)
    at com.lucky.order.remote.core.impl.QueryOrderDetailRemoteServiceImpl.queryOrderDetailById4MAPI(QueryOrderDetailRemoteServiceImpl.java:475)
    at sun.reflect.GeneratedMethodAccessor503.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.zuche.framework.remote.AbstractRemoteService.invokeWithTransactional(AbstractRemoteService.java:290)
    at com.zuche.framework.remote.AbstractRemoteService.executeServiceNew(AbstractRemoteService.java:116)
    at com.zuche.framework.remote.AbstractRemoteService.executeServiceInvocation(AbstractRemoteService.java:65)
    at com.zuche.framework.remote.AbstractRemoteService$$FastClassByCGLIB$$67d82e8b.invoke()
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at com.zuche.framework.prism.entrypoint.proxy.ServiceRemoteInterceptor.invoke(ServiceRemoteInterceptor.java:99)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
    at com.lucky.order.remote.core.impl.QueryOrderDetailRemoteServiceImpl$$EnhancerByCGLIB$$fdfdaa43.executeServiceInvocation()
    at com.zuche.framework.remote.AbstractRemoteService$$FastClassByCGLIB$$67d82e8b.invoke()
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
    at com.lucky.base.common.logcore.aspect.LuckyLogAspect.around(LuckyLogAspect.java:90)
    at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
    at com.lucky.order.remote.core.impl.QueryOrderDetailRemoteServiceImpl$$EnhancerByCGLIB$$43b46ca7.executeServiceInvocation()
    at com.zuche.framework.remote.nio.handler.HessianServerHandler.invoke(HessianServerHandler.java:178)
    at com.zuche.framework.remote.nio.handler.HessianServerHandler.messageReceived(HessianServerHandler.java:100)
    at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
    at com.zuche.framework.remote.nio.handler.HessianServerHandler.handleUpstream(HessianServerHandler.java:46)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
    at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:43)
    at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:67)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.tomcat.jdbc.pool.PoolExhaustedException: [pool-48-thread-11049] Timeout: Pool empty. Unable to fetch a connection in 10 seconds, none available[size:40; busy:40; idle:0; lastwait:9999].
    at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:689)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:173)
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:134)
    at com.zuche.framework.jdbcpool.DynDataSource.getConnection(DynDataSource.java:46)
    at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:139)
    at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
    ... 81 more

3、nested exception is com.ibatis.common.jdbc.exception.NestedSQLException,The last packet sent successfully to the server was 2,245 milliseconds ago


连接已经坏掉,网络不可用,或者是数据库服务端已经关闭了这个连接

[RPC][EXCEPTION]serviceid:order-service.orderlist.queryOrderListByMember4APP,uuid:16889eb01b7745b6bb85ab6696d0560c,param:[{"category":"ALL","memberId":245695185,"offset":15,"pageSize":15}] org.springframework.dao.DataAccessResourceFailureException: SqlMapClient operation; SQL [];  
--- The error occurred while applying a parameter map. 
--- Check the QueryOrderListDao.queryOrderParentIdsByMember-InlineParameterMap. 
--- Check the statement (query failed). 
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
 
The last packet successfully received from the server was 24,910 milliseconds ago.  The last packet sent successfully to the server was 2,245 milliseconds ago.; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred while applying a parameter map. 
--- Check the QueryOrderListDao.queryOrderParentIdsByMember-InlineParameterMap. 
--- Check the statement (query failed). 
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
 
The last packet successfully received from the server was 24,910 milliseconds ago.  The last packet sent successfully to the server was 2,245 milliseconds ago.
    at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:104)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    at com.zuche.framework.extend.spring.SqlMapClientTemplateExtend.execute(SqlMapClientTemplateExtend.java:395)
    at com.zuche.framework.extend.spring.SqlMapClientTemplateExtend.executeWithLogger(SqlMapClientTemplateExtend.java:204)
    at com.zuche.framework.extend.spring.SqlMapClientTemplateExtend.executeWithListResult(SqlMapClientTemplateExtend.java:512)
    at com.zuche.framework.extend.spring.SqlMapClientTemplateExtend.queryForList(SqlMapClientTemplateExtend.java:608)
    at com.zuche.framework.dao.IbatisDaoImpl.queryForList(IbatisDaoImpl.java:208)
    at com.lucky.order.local.core.dao.mysql.QueryOrderListDao.queryOrderParentIdsByMember(QueryOrderListDao.java:50)
    at com.lucky.order.local.core.service.impl.OrderZCacheByMemberServiceImpl.queryOrderParentIdsByMember(OrderZCacheByMemberServiceImpl.java:977)
    at com.lucky.order.local.core.service.impl.OrderZCacheByMemberServiceImpl.refillOrderFromDB(OrderZCacheByMemberServiceImpl.java:360)
    at com.lucky.order.local.core.service.impl.OrderZCacheByMemberServiceImpl.queryOrderIdsDirectFromCache(OrderZCacheByMemberServiceImpl.java:338)
    at com.lucky.order.local.core.service.impl.OrderZCacheByMemberServiceImpl.queryOrderIdsByMemberAndStatusCateWithPage(OrderZCacheByMemberServiceImpl.java:482)
    at com.lucky.order.local.core.service.impl.OrderZCacheByMemberServiceImpl.generateNestedOrder(OrderZCacheByMemberServiceImpl.java:686)
    at com.lucky.order.remote.core.impl.QueryOrderListRemoteServiceImpl.queryOrderListByCategory4APP(QueryOrderListRemoteServiceImpl.java:312)
    at com.lucky.order.remote.core.impl.QueryOrderListRemoteServiceImpl$13.execute(QueryOrderListRemoteServiceImpl.java:555)
    at com.lucky.order.common.util.BaseRemoteService.execute(BaseRemoteService.java:138)
    at com.lucky.order.remote.core.impl.QueryOrderListRemoteServiceImpl.queryOrderListByMember4APP(QueryOrderListRemoteServiceImpl.java:546)
    at sun.reflect.GeneratedMethodAccessor215.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.zuche.framework.remote.AbstractRemoteService.invokeWithTransactional(AbstractRemoteService.java:290)
    at com.zuche.framework.remote.AbstractRemoteService.executeServiceNew(AbstractRemoteService.java:116)
    at com.zuche.framework.remote.AbstractRemoteService.executeServiceInvocation(AbstractRemoteService.java:65)
    at com.zuche.framework.remote.AbstractRemoteService$$FastClassByCGLIB$$67d82e8b.invoke()
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at com.zuche.framework.prism.entrypoint.proxy.ServiceRemoteInterceptor.invoke(ServiceRemoteInterceptor.java:99)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
    at com.lucky.order.remote.core.impl.QueryOrderListRemoteServiceImpl$$EnhancerByCGLIB$$38b9f2e5.executeServiceInvocation()
    at com.zuche.framework.remote.AbstractRemoteService$$FastClassByCGLIB$$67d82e8b.invoke()
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
    at com.lucky.base.common.logcore.aspect.LuckyLogAspect.around(LuckyLogAspect.java:90)
    at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
    at com.lucky.order.remote.core.impl.QueryOrderListRemoteServiceImpl$$EnhancerByCGLIB$$dfa8cf65.executeServiceInvocation()
    at com.zuche.framework.remote.nio.handler.HessianServerHandler.invoke(HessianServerHandler.java:178)
    at com.zuche.framework.remote.nio.handler.HessianServerHandler.messageReceived(HessianServerHandler.java:100)
    at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
    at com.zuche.framework.remote.nio.handler.HessianServerHandler.handleUpstream(HessianServerHandler.java:46)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
    at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:43)
    at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:67)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred while applying a parameter map. 
--- Check the QueryOrderListDao.queryOrderParentIdsByMember-InlineParameterMap. 
--- Check the statement (query failed). 
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
 
The last packet successfully received from the server was 24,910 milliseconds ago.  The last packet sent successfully to the server was 2,245 milliseconds ago.
    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:424)
    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:295)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:558)
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
    at com.zuche.framework.extend.spring.SqlMapClientTemplateExtend$4.doInSqlMapClient(SqlMapClientTemplateExtend.java:610)
    at com.zuche.framework.extend.spring.SqlMapClientTemplateExtend.execute(SqlMapClientTemplateExtend.java:389)
    ... 56 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
 
The last packet successfully received from the server was 24,910 milliseconds ago.  The last packet sent successfully to the server was 2,245 milliseconds ago.
    at sun.reflect.GeneratedConstructorAccessor243.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:408)
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1137)
    at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3983)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2596)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2840)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2082)
    at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1302)
    at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:313)
    at com.zuche.framework.dao.dialect.PageSqlExecutor.executeQuery(PageSqlExecutor.java:70)
    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteQuery(MappedStatement.java:608)
    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteQueryOnlyOne(MappedStatement.java:494)
    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:397)
    ... 62 more
Caused by: java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:159)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3964)
    ... 72 more

4.com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Can't call rollback when autocommit=true


出现此问题的原因在于,当连接的autocommit是true,即没有开启事物,此时此连接调用conn.rollback()时会报错。

[RPC][EXCEPTION]serviceid:order-service.coffeeMaker.acceptCallback,uuid:5d11b6b545c046f79d95efe074cc3589,param:[{"acceptTime":1568093057404,"acceptType":2,"operOrigin":3,"operUser":77951,"orderId":6734896989937270797,"productUser":86568,"productUserName":"CLEVEN"}] org.springframework.transaction.TransactionSystemException: Could not roll back JDBC transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Can't call rollback when autocommit=true
    at com.zuche.framework.extend.spring.sddl.DataSourceTransactionManager.doRollback(DataSourceTransactionManager.java:332)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:845)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:822)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:410)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:114)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
    at com.lucky.order.local.core.service.impl.OrderCoffeeMakerServiceImpl$$EnhancerByCGLIB$$1db0ffe3.accept()
    at com.lucky.order.local.core.service.impl.OrderCoffeeMakerServiceImpl.acceptCallbackEX(OrderCoffeeMakerServiceImpl.java:503)
    at com.lucky.order.local.core.service.impl.OrderCoffeeMakerServiceImpl$$FastClassByCGLIB$$7f68af2f.invoke()
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:618)
    at com.lucky.order.local.core.service.impl.OrderCoffeeMakerServiceImpl$$EnhancerByCGLIB$$1db0ffe3.acceptCallbackEX()
    at com.lucky.order.remote.core.impl.CoffeeMakerRemoteServiceImpl$1.execute(CoffeeMakerRemoteServiceImpl.java:54)
    at com.lucky.order.common.util.BaseRemoteService.execute(BaseRemoteService.java:138)
    at com.lucky.order.remote.core.impl.CoffeeMakerRemoteServiceImpl.acceptCallback(CoffeeMakerRemoteServiceImpl.java:50)
    at sun.reflect.GeneratedMethodAccessor767.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.zuche.framework.remote.AbstractRemoteService.invokeWithTransactional(AbstractRemoteService.java:290)
    at com.zuche.framework.remote.AbstractRemoteService.executeServiceNew(AbstractRemoteService.java:116)
    at com.zuche.framework.remote.AbstractRemoteService.executeServiceInvocation(AbstractRemoteService.java:65)
    at com.zuche.framework.remote.AbstractRemoteService$$FastClassByCGLIB$$67d82e8b.invoke()
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at com.zuche.framework.prism.entrypoint.proxy.ServiceRemoteInterceptor.invoke(ServiceRemoteInterceptor.java:99)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
    at com.lucky.order.remote.core.impl.CoffeeMakerRemoteServiceImpl$$EnhancerByCGLIB$$da548e9a.executeServiceInvocation()
    at com.zuche.framework.remote.AbstractRemoteService$$FastClassByCGLIB$$67d82e8b.invoke()
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
    at com.lucky.base.common.logcore.aspect.LuckyLogAspect.around(LuckyLogAspect.java:90)
    at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
    at com.lucky.order.remote.core.impl.CoffeeMakerRemoteServiceImpl$$EnhancerByCGLIB$$363e8bc2.executeServiceInvocation()
    at com.zuche.framework.remote.nio.handler.HessianServerHandler.invoke(HessianServerHandler.java:178)
    at com.zuche.framework.remote.nio.handler.HessianServerHandler.messageReceived(HessianServerHandler.java:100)
    at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
    at com.zuche.framework.remote.nio.handler.HessianServerHandler.handleUpstream(HessianServerHandler.java:46)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
    at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:43)
    at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:67)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Can't call rollback when autocommit=true
    at sun.reflect.GeneratedConstructorAccessor228.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:408)
    at com.mysql.jdbc.Util.getInstance(Util.java:383)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1023)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:997)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:983)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:928)
    at com.mysql.jdbc.ConnectionImpl.rollback(ConnectionImpl.java:5078)
    at sun.reflect.GeneratedMethodAccessor584.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
    at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108)
    at org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:81)
    at com.sun.proxy.$Proxy51.rollback(Unknown Source)
    at com.zuche.framework.extend.spring.sddl.ShardingConnection.rollback(ShardingConnection.java:171)
    at com.zuche.framework.extend.spring.sddl.DataSourceTransactionManager.doRollback(DataSourceTransactionManager.java:329)
    ... 57 more

5、Lock wait timeout exceeded; try restarting transaction:
数据库连接出现锁等待,说明当前访问的记录被锁定,说明有未提交的事物

Application exception overridden by rollback exception org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [41000]; error code [1205];  
--- The error occurred while applying a parameter map. 
--- Check the OrderPayDao.updateOrderPay-InlineParameterMap. 
--- Check the statement (update failed). 
--- Cause: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred while applying a parameter map. 
--- Check the OrderPayDao.updateOrderPay-InlineParameterMap. 
--- Check the statement (update failed). 
--- Cause: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    at com.zuche.framework.extend.spring.SqlMapClientTemplateExtend.execute(SqlMapClientTemplateExtend.java:395)
    at com.zuche.framework.extend.spring.SqlMapClientTemplateExtend.executeWithLogger(SqlMapClientTemplateExtend.java:204)
    at com.zuche.framework.extend.spring.SqlMapClientTemplateExtend.update(SqlMapClientTemplateExtend.java:777)
    at com.zuche.framework.dao.IbatisDaoImpl.update(IbatisDaoImpl.java:196)
    at com.lucky.order.local.price.dao.OrderPayDao.updateOrderPay(OrderPayDao.java:32)
    at com.lucky.order.local.price.service.impl.OrderPayServiceImpl.updateOrderPay(OrderPayServiceImpl.java:59)
    at com.lucky.order.local.core.service.impl.OrderBaseServiceImpl.paySuccess(OrderBaseServiceImpl.java:503)
    at com.lucky.order.local.core.service.impl.OrderBaseServiceImpl.paymentFromUser(OrderBaseServiceImpl.java:493)
    at com.lucky.order.local.core.service.impl.OrderBaseServiceImpl$$FastClassByCGLIB$$8eab7772.invoke()
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
    at com.lucky.order.local.core.service.impl.OrderBaseServiceImpl$$EnhancerByCGLIB$$9cd37a78.paymentFromUser()
    at com.lucky.order.remote.core.impl.OrderRemoteServiceImpl$SigleOrderPayExecutor.execute(OrderRemoteServiceImpl.java:428)
    at com.lucky.order.common.util.BaseRemoteService.execute(BaseRemoteService.java:138)
    at com.lucky.order.remote.core.impl.OrderRemoteServiceImpl.paymentOrderFromUser(OrderRemoteServiceImpl.java:396)
    at sun.reflect.GeneratedMethodAccessor777.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.zuche.framework.remote.AbstractRemoteService.invokeWithTransactional(AbstractRemoteService.java:290)
    at com.zuche.framework.remote.AbstractRemoteService.executeServiceNew(AbstractRemoteService.java:116)
    at com.zuche.framework.remote.AbstractRemoteService.executeServiceInvocation(AbstractRemoteService.java:65)
    at com.zuche.framework.remote.AbstractRemoteService$$FastClassByCGLIB$$67d82e8b.invoke()
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at com.zuche.framework.prism.entrypoint.proxy.ServiceRemoteInterceptor.invoke(ServiceRemoteInterceptor.java:99)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
    at com.lucky.order.remote.core.impl.OrderRemoteServiceImpl$$EnhancerByCGLIB$$54f88e0a.executeServiceInvocation()
    at com.zuche.framework.remote.AbstractRemoteService$$FastClassByCGLIB$$67d82e8b.invoke()
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
    at com.lucky.base.common.logcore.aspect.LuckyLogAspect.around(LuckyLogAspect.java:90)
    at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
    at com.lucky.order.remote.core.impl.OrderRemoteServiceImpl$$EnhancerByCGLIB$$824ec673.executeServiceInvocation()
    at com.zuche.framework.remote.nio.handler.HessianServerHandler.invoke(HessianServerHandler.java:178)
    at com.zuche.framework.remote.nio.handler.HessianServerHandler.messageReceived(HessianServerHandler.java:100)
    at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
    at com.zuche.framework.remote.nio.handler.HessianServerHandler.handleUpstream(HessianServerHandler.java:46)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
    at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:43)
    at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:67)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred while applying a parameter map. 
--- Check the OrderPayDao.updateOrderPay-InlineParameterMap. 
--- Check the statement (update failed). 
--- Cause: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:219)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.update(SqlMapExecutorDelegate.java:474)
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.update(SqlMapSessionImpl.java:90)
    at com.zuche.framework.extend.spring.SqlMapClientTemplateExtend$13.doInSqlMapClient(SqlMapClientTemplateExtend.java:779)
    at com.zuche.framework.extend.spring.SqlMapClientTemplateExtend.execute(SqlMapClientTemplateExtend.java:389)
    ... 60 more
Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1094)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4226)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4158)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2840)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2082)
    at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1302)
    at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:110)
    at com.zuche.framework.dao.dialect.PageSqlExecutor.executeUpdate(PageSqlExecutor.java:45)
    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteUpdate(MappedStatement.java:603)
    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteUpdateWhenSddl(MappedStatement.java:248)
    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:196)
    ... 64 more

你可能感兴趣的:(mysql)