473,414 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

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 11681

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jeremiah Jacks | last post by:
I just upgraded to MySQL 4.0.14-standard for RedHat Linux and am using = the pre-compiled binaries. I have a database with INNODB tables. When I insert a row into one of the child tables, I get...
8
by: Anita | last post by:
Hi All, Can multiple updates on one table using single query generate deadlock ? For example, at the same time, there are 2 users run 2 queries as follows : User1 runs : update tab1 set...
0
by: steven | last post by:
In both mysql version 4.0.16 and 4.1.8 I'm running into deadlock behavior that I don't understand: can anyone explain why the following happens? Heres a basic table definition that exhibits the...
2
by: Alex | last post by:
I was hoping someone could confirm my understanding of how InnoDB handles deadlocks (error 1213) and timeouts (error 1206). The way I understand it, with AUTOCOMMIT=0, if I issue 3 SQL statements...
3
by: Nigel Robbins | last post by:
Hi There, I'm getting a deadlock when I have two clients running the following statement. DELETE FROM intermediate.file_os_details WHERE file_uid = ? AND obj_uid There is a compound index on...
1
by: Rohit Raghuwanshi | last post by:
Hello all, we are running a delphi application with DB2 V8.01 which is causing deadlocks when rows are being inserted into a table. Attaching the Event Monitor Log (DEADLOCKS WITH DETAILS) here....
0
by: fuzzybr80 | last post by:
Hi, I am working with an application with a high rate of inserts/updates/deletes into a particular table, and recently am getting the following error code. My table uses InnoDB engine. ERROR...
1
by: Arif Mohammed | last post by:
Hi, iam using MySql 4.0.1 and jboss-4.0.4.GA Iam getting the following exception when there are more concurrent requests more than 50 in a second Caused by: org.xyz.MyClass: SQL...
1
by: kalpacx | last post by:
Hi All, I am a newbie to db2 database. Currently i am facing an issue which i know for sure that many would have faced and resolved. I am running 6 sql scripts concurrently against the db ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.