日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

java.sql.SQLException: Lock wait timeout exceeded --转

發布時間:2025/4/5 数据库 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java.sql.SQLException: Lock wait timeout exceeded --转 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

?org.springframework.dao.CannotAcquireLockException 的解決》

? ? ? ? 直接上?bug 的詳細信息

?

2012-03-12 15:20:31 XmlBeanDefinitionReader [INFO] Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml] 2012-03-12 15:20:31 SQLErrorCodesFactory [INFO] SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase] 2012-03-12 15:20:31 ExceptionUtil [ERROR] SqlMapClient operation; SQL []; --- The error occurred in com/defonds/syncpath/dao/operation.xml. --- The error occurred while applying a parameter map. --- Check the operation.updateShareStatus-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 in com/defonds/syncpath/dao/operation.xml. --- The error occurred while applying a parameter map. --- Check the operation.updateShareStatus-InlineParameterMap. --- Check the statement (update failed). --- Cause: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction org.springframework.dao.CannotAcquireLockException: SqlMapClient operation; SQL []; --- The error occurred in com/defonds/syncpath/dao/operation.xml. --- The error occurred while applying a parameter map. --- Check the operation.updateShareStatus-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 in com/defonds/syncpath/dao/operation.xml. --- The error occurred while applying a parameter map. --- Check the operation.updateShareStatus-InlineParameterMap. --- Check the statement (update failed). --- Cause: java.sql.SQLException: Lock wait timeout exceeded; try restarting transactionat org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:244)at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:212)at com.defonds.frameworkcommons.dao.BaseDaoImpl.execute(BaseDaoImpl.java:31)at com.defonds.frameworkcommons.dao.BaseDaoImpl.update(BaseDaoImpl.java:97)at com.defonds.syncpath.service.operation.impl.OperationServiceImpl.revokeSharedFolder(OperationServiceImpl.java:287)at com.defonds.syncpath.service.share.impl.ShareServiceImpl.handleRevokeSharedFolder(ShareServiceImpl.java:312)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:597)at com.defonds.interfaceframework.controller.Action.invokeMethod(Action.java:256)at com.defonds.interfaceframework.controller.Action.execute(Action.java:206)at com.defonds.interfaceframework.controller.DispatcherServlet.service(DispatcherServlet.java:144)at com.defonds.syncpath.common.ArcSyncDispatcherServlet.service(ArcSyncDispatcherServlet.java:51)at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)at java.lang.Thread.run(Thread.java:619)

? ? ? ??分析原因

? ? ? ??Spring 事務嵌套造成死鎖。FileServiceImpl 里嵌入了?OperationService:

?

private OperationService operationService;

? ? ? ??FileServiceImpl 的 delete 方法里對 MySQL 的 file 表有操作,而?OperationService 里的?revokeSharedFolder 方法也對同一張表有更新操作。事務嵌套,造成死鎖。

? ? ? ??解決方案

? ? ? ??當前調用事務的方法設置為?Propagation.SUPPORTS:

?

@Transactional(propagation=Propagation.SUPPORTS)//by Defonds,for BUG094537@Overridepublic void delete(int uid, int[] itemIds) {if (itemIds != null && itemIds.length > 0) {

原文地址:http://www.xuebuyuan.com/958812.html

?

轉載于:https://www.cnblogs.com/davidwang456/p/4270458.html

總結

以上是生活随笔為你收集整理的java.sql.SQLException: Lock wait timeout exceeded --转的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。