469,644 Members | 1,774 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,644 developers. It's quick & easy.

Deadlock found when trying to get lock (MySQL 5.0 with innodb)

Hi!

We are using apache ibatis with our MySQL 5.0 database (using innodb
tables), in our web application running on Tomcat 5. Recently we
started getting a number of errors relating to
java.sql.SQLException: Deadlock found when trying to get lock; Try
restarting transaction message from server: "Lock wait timeout
exceeded; try restarting transaction";

We get such errors generally on inserts or updates while applying a
parameter map - see full exception dump below. It takes a tomcat/web
application restart to fix the problem. We've checked "SHOW INNODB
STATUS" on our database and it does not show any deadlock errors (no
LAST DEADLOCK ERROR section).

We would appreciate any suggestions or ideas you have to fix or
alleviate this problem. Thanks :)
Full exception dump:
note: my.application.* is our application code

2006-12-08 23:48:32,347 ERROR [TP-Processor24] servlet.FrameworkServlet
(FrameworkServlet.java:412) - Could not complete request
org.springframework.jdbc.UncategorizedSQLException : SqlMapClient
operation; uncategorized SQLException for SQL []; SQL state [41000];
error code [1205];
--- The error occurred in
my/application/engine/dao/ibatis/maps/Section.xml.
--- The error occurred while applying a parameter map.
--- Check the updateSectionExperience-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: java.sql.SQLException: Deadlock found when trying to get
lock; Try restarting transaction message from server: "Lock wait
timeout exceeded; try restarting transaction"; nested exception is
com.ibatis.common.jdbc.exception.NestedSQLExceptio n:
--- The error occurred in
my/application/engine/dao/ibatis/maps/Section.xml.
--- The error occurred while applying a parameter map.
--- Check the updateSectionExperience-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: java.sql.SQLException: Deadlock found when trying to get
lock; Try restarting transaction message from server: "Lock wait
timeout exceeded; try restarting transaction"
com.ibatis.common.jdbc.exception.NestedSQLExceptio n:
--- The error occurred in
my/application/engine/dao/ibatis/maps/Section.xml.
--- The error occurred while applying a parameter map.
--- Check the updateSectionExperience-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: java.sql.SQLException: Deadlock found when trying to get
lock; Try restarting transaction message from server: "Lock wait
timeout exceeded; try restarting transaction"
Caused by: java.sql.SQLException: Deadlock found when trying to get
lock; Try restarting transaction message from server: "Lock wait
timeout exceeded; try restarting transaction"
at
com.ibatis.sqlmap.engine.mapping.statement.General Statement.executeUpdate(GeneralStatement.java:91)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelega te.update(SqlMapExecutorDelegate.java:500)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.up date(SqlMapSessionImpl.java:85)
at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.upd ate(SqlMapClientImpl.java:62)
at
org.springframework.orm.ibatis.SqlMapClientTemplat e$10.doInSqlMapClient(SqlMapClientTemplate.java:32 9)
at
org.springframework.orm.ibatis.SqlMapClientTemplat e.execute(SqlMapClientTemplate.java:165)
at
org.springframework.orm.ibatis.SqlMapClientTemplat e.update(SqlMapClientTemplate.java:327)
at
org.springframework.orm.ibatis.SqlMapClientTemplat e.update(SqlMapClientTemplate.java:349)
at
my.application.engine.dao.ibatis.SqlMapSectionDao. updateSectionExperience(Unknown
Source)
at
my.application.engine.domain.logic.SystemImpl.upda teSectionExperience(Unknown
Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.springframework.aop.support.AopUtils.invokeJoi npointUsingReflection(AopUtils.java:335)
at
org.springframework.aop.framework.ReflectiveMethod Invocation.invokeJoinpoint(ReflectiveMethodInvocat ion.java:181)
at
org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :148)
at
org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:96)
at
org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :170)
at
org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:176)
at $Proxy0.updateSectionExperience(Unknown Source)
at
my.application.engine.web.SectionFormController.pr ocessFinish(Unknown
Source)
at
org.springframework.web.servlet.mvc.AbstractWizard FormController.validatePagesAndFinish(AbstractWiza rdFormController.java:667)
at
org.springframework.web.servlet.mvc.AbstractWizard FormController.processFormSubmission(AbstractWizar dFormController.java:490)
at
org.springframework.web.servlet.mvc.AbstractFormCo ntroller.handleRequestInternal(AbstractFormControl ler.java:259)
at
org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:139)
at
org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:44)
at
org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:717)
at
org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:658)
at
org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:392)
at
org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:357)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
at
org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:214)
at
org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
at
org.apache.catalina.core.StandardContextValve.invo keInternal(StandardContextValve.java:198)
at
org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:152)
at
org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
at
org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:137)
at
org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
at
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:118)
at
org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
at
org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
at
org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
at
org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:929)
at
org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:160)
at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyo teHandler.java:300)
at org.apache.jk.common.HandlerRequest.invoke(Handler Request.java:374)
at org.apache.jk.common.ChannelSocket.invoke(ChannelS ocket.java:743)
at
org.apache.jk.common.ChannelSocket.processConnecti on(ChannelSocket.java:675)
at org.apache.jk.common.SocketConnection.runIt(Channe lSocket.java:866)
at
org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: Deadlock found when trying to get
lock; Try restarting transaction message from server: "Lock wait
timeout exceeded; try restarting transaction"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:1997)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:11 67)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java :1278)
at com.mysql.jdbc.Connection.execSQL(Connection.java: 2247)
at
com.mysql.jdbc.PreparedStatement.execute(PreparedS tatement.java:1371)
at
org.apache.commons.dbcp.DelegatingPreparedStatemen t.execute(DelegatingPreparedStatement.java:168)
at sun.reflect.GeneratedMethodAccessor40.invoke(Unkno wn Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com.ibatis.common.jdbc.logging.PreparedStatementLo gProxy.invoke(PreparedStatementLogProxy.java:62)
at $Proxy3.execute(Unknown Source)
at
com.ibatis.sqlmap.engine.execution.SqlExecutor.exe cuteUpdate(SqlExecutor.java:84)
at
com.ibatis.sqlmap.engine.mapping.statement.General Statement.sqlExecuteUpdate(GeneralStatement.java:2 00)
at
com.ibatis.sqlmap.engine.mapping.statement.General Statement.executeUpdate(GeneralStatement.java:78)
... 58 more

Caused by:
java.sql.SQLException: Deadlock found when trying to get lock; Try
restarting transaction message from server: "Lock wait timeout
exceeded; try restarting transaction"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:1997)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:11 67)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java :1278)
at com.mysql.jdbc.Connection.execSQL(Connection.java: 2247)
at
com.mysql.jdbc.PreparedStatement.execute(PreparedS tatement.java:1371)
at
org.apache.commons.dbcp.DelegatingPreparedStatemen t.execute(DelegatingPreparedStatement.java:168)
at sun.reflect.GeneratedMethodAccessor40.invoke(Unkno wn Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com.ibatis.common.jdbc.logging.PreparedStatementLo gProxy.invoke(PreparedStatementLogProxy.java:62)
at $Proxy3.execute(Unknown Source)
at
com.ibatis.sqlmap.engine.execution.SqlExecutor.exe cuteUpdate(SqlExecutor.java:84)
at
com.ibatis.sqlmap.engine.mapping.statement.General Statement.sqlExecuteUpdate(GeneralStatement.java:2 00)
at
com.ibatis.sqlmap.engine.mapping.statement.General Statement.executeUpdate(GeneralStatement.java:78)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelega te.update(SqlMapExecutorDelegate.java:500)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.up date(SqlMapSessionImpl.java:85)
at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.upd ate(SqlMapClientImpl.java:62)
at
org.springframework.orm.ibatis.SqlMapClientTemplat e$10.doInSqlMapClient(SqlMapClientTemplate.java:32 9)
at
org.springframework.orm.ibatis.SqlMapClientTemplat e.execute(SqlMapClientTemplate.java:165)
at
org.springframework.orm.ibatis.SqlMapClientTemplat e.update(SqlMapClientTemplate.java:327)
at
org.springframework.orm.ibatis.SqlMapClientTemplat e.update(SqlMapClientTemplate.java:349)
at
my.application.engine.dao.ibatis.SqlMapSectionDao. updateSectionExperience(Unknown
Source)
at
my.application.engine.domain.logic.SystemImpl.upda teSectionExperience(Unknown
Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.springframework.aop.support.AopUtils.invokeJoi npointUsingReflection(AopUtils.java:335)
at
org.springframework.aop.framework.ReflectiveMethod Invocation.invokeJoinpoint(ReflectiveMethodInvocat ion.java:181)
at
org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :148)
at
org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:96)
at
org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :170)
at
org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:176)
at $Proxy0.updateSectionExperience(Unknown Source)
at
my.application.engine.web.SectionFormController.pr ocessFinish(Unknown
Source)
at
org.springframework.web.servlet.mvc.AbstractWizard FormController.validatePagesAndFinish(AbstractWiza rdFormController.java:667)
at
org.springframework.web.servlet.mvc.AbstractWizard FormController.processFormSubmission(AbstractWizar dFormController.java:490)
at
org.springframework.web.servlet.mvc.AbstractFormCo ntroller.handleRequestInternal(AbstractFormControl ler.java:259)
at
org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:139)
at
org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:44)
at
org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:717)
at
org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:658)
at
org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:392)
at
org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:357)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
at
org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:214)
at
org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
at
org.apache.catalina.core.StandardContextValve.invo keInternal(StandardContextValve.java:198)
at
org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:152)
at
org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
at
org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:137)
at
org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
at
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:118)
at
org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
at
org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
at
org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
at
org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:929)
at
org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:160)
at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyo teHandler.java:300)
at org.apache.jk.common.HandlerRequest.invoke(Handler Request.java:374)
at org.apache.jk.common.ChannelSocket.invoke(ChannelS ocket.java:743)
at
org.apache.jk.common.ChannelSocket.processConnecti on(ChannelSocket.java:675)
at org.apache.jk.common.SocketConnection.runIt(Channe lSocket.java:866)
at
org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

Dec 11 '06 #1
0 11431

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jeremiah Jacks | last post: by
8 posts views Thread by Anita | last post: by
2 posts views Thread by Alex | last post: by
3 posts views Thread by Nigel Robbins | last post: by
reply views Thread by fuzzybr80 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.