Hello experts,
In my application i am using spring, hibernate 3, osworkflow2.8.0 and Mysql. It is working fine, while I’m tried to load test my application I got an exception {org.hibernate.exception.LockAcquisitionException: could not update :}, because of multiple threads are trying to update a resource which is already updated by another thread.
Exactly what I’m doing is, move a record from current step to history step by very first time only (ie, first user). I get the current step and check conditions, if it is true then I move to history step. This logic is working fine when test by manually, Now the problem was occurred during load test (jMeter 2.4). The following log for your reference.
org.hibernate.event.def.AbstractFlushingEventListe ner.performExecutions(AbstractFlushingEventListene r.java:324)org.hibernate.exception.LockAcquisition Exception: could not update: [com.opensymphony.workflow.spi.hibernate.HibernateW orkflowEntry#1] at org.hibernate.exception.SQLStateConverter.convert( SQLStateConverter.java:105) at org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelper.java:66) at org.hibernate.persister.entity.AbstractEntityPersi ster.update(AbstractEntityPersister.java:2453) at org.hibernate.persister.entity.AbstractEntityPersi ster.updateOrInsert(AbstractEntityPersister.java:2 335) at org.hibernate.persister.entity.AbstractEntityPersi ster.update(AbstractEntityPersister.java:2635) at org.hibernate.action.EntityUpdateAction.execute(En tityUpdateAction.java:115) at org.hibernate.engine.ActionQueue.execute(ActionQue ue.java:279) at org.hibernate.engine.ActionQueue.executeActions(Ac tionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(Ac tionQueue.java:168) at org.hibernate.event.def.AbstractFlushingEventListe ner.performExecutions(AbstractFlushingEventListene r.java:321) at org.hibernate.event.def.DefaultFlushEventListener. onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.j ava:1027) at org.hibernate.impl.SessionImpl.managedFlush(Sessio nImpl.java:365) at org.hibernate.transaction.JDBCTransaction.commit(J DBCTransaction.java:137) at org.springframework.orm.hibernate3.HibernateTransa ctionManager.doCommit(HibernateTransactionManager. java:596) at org.springframework.transaction.support.AbstractPl atformTransactionManager.processCommit(AbstractPla tformTransactionManager.java:709) at org.springframework.transaction.support.AbstractPl atformTransactionManager.commit(AbstractPlatformTr ansactionManager.java:678) at org.springframework.transaction.interceptor.Transa ctionAspectSupport.commitTransactionAfterReturning (TransactionAspectSupport.java:319) at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:116) at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171) at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204) at $Proxy21.doAction(Unknown Source) at com.percipient.assessmentengine.controller.ExamCon troller.navigate(ExamController.java:544) at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.invokeNamedMethod(MultiActionC ontroller.java:473) at org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.handleRequestInternal(MultiAct ionController.java:410) at org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:48) at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:875) at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:809) at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:476) at org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:441) 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 com.percipient.assessmentengine.utils.AssessmentEn gineFilter.doFilter(AssessmentEngineFilter.java:11 0) at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source) Caused by: com.mysql.jdbc.exceptions.MySQLTransactionRollback Exception: Deadlock found when trying to get lock; try restarting transaction at com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:941) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:2870) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:15 73) at com.mysql.jdbc.ServerPreparedStatement.serverExecu te(ServerPreparedStatement.java:1160) at com.mysql.jdbc.ServerPreparedStatement.executeInte rnal(ServerPreparedStatement.java:685) at com.mysql.jdbc.PreparedStatement.executeUpdate(Pre paredStatement.java:1400) at com.mysql.jdbc.PreparedStatement.executeUpdate(Pre paredStatement.java:1314) at com.mysql.jdbc.PreparedStatement.executeUpdate(Pre paredStatement.java:1299) at org.hibernate.persister.entity.AbstractEntityPersi ster.update(AbstractEntityPersister.java:2435) ... 51 more
I really need some help to solve this problem, Couple of days I trying to solve this, still I have this.
Thankyou, udhayakumar
|