超时机制
Posted igoodful
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了超时机制相关的知识,希望对你有一定的参考价值。
mysql连接的超时问题:Communications link failure
org.springframework.dao.RecoverableDataAccessException: ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 1,454,140 milliseconds ago. The last packet sent successfully to the server was 1,454,141 milliseconds ago. ### The error may involve miCoupon.unfreeze-Inline ### The error occurred while setting parameters ### SQL: update mi_coupon set status = 1, consume_xiaomi_id = null, consume_order_id = null, lock_time = null where consume_order_id=? and status=2 ### Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 1,454,140 milliseconds ago. The last packet sent successfully to the server was 1,454,141 milliseconds ago. ; SQL []; Communications link failure The last packet successfully received from the server was 1,454,140 milliseconds ago. The last packet sent successfully to the server was 1,454,141 milliseconds ago.; nested exception is com.mysql.jdbc.e xceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 1,454,140 milliseconds ago. The last packet sent successfully to the server was 1,454,141 milliseconds ago. at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:98) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:82) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) at com.sun.proxy.$Proxy13.update(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:294) at com.xiaomi.bss2.dao.MiCouponDao.unfreeze(MiCouponDao.java:23) at com.xiaomi.bss2.service.MiCouponService.unfreeze(MiCouponService.java:27) at com.xiaomi.bss2.main.Bss2ServiceImpl.cancelOrder(Bss2ServiceImpl.java:63) at com.xiaomi.bss2.main.Bss2ServiceImpl$$FastClassBySpringCGLIB$$67f6d028.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671) at com.xiaomi.bss2.main.Bss2ServiceImpl$$EnhancerBySpringCGLIB$$ea0735d6.cancelOrder(<generated>) at com.xiaomi.bss2.main.Bss2ServiceThriftImpl$1.handle(Bss2ServiceThriftImpl.java:35) at com.xiaomi.bss2.main.Bss2ServiceThriftImpl$1.handle(Bss2ServiceThriftImpl.java:32) at com.xiaomi.bss2.main.Bss2ServiceThriftImpl.handle(Bss2ServiceThriftImpl.java:87) at com.xiaomi.bss2.main.Bss2ServiceThriftImpl.cancelOrder(Bss2ServiceThriftImpl.java:32) at sun.reflect.GeneratedMethodAccessor233.invoke(Unknown Source)
以上是关于超时机制的主要内容,如果未能解决你的问题,请参考以下文章
Gochannel超时机制触发的(fatal error: all goroutines are asleep - deadlock!)