com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • GitHub comment 1395#243960689
    via GitHub by swcumt
    ,
  • My transformation makes logging in MySQL tables t_trans. Running transformation in parallel causes sometime a DB DEADLOCK at cleanup phase. Here's what ERROR 12-04 12:31:19,655 - copy files command line - copy files command line : Unexpected error at the end of the transformation ERROR 12-04 12:31:19,655 - copy files command line - org.pentaho.di.core.exception.KettleException: Unable to perform logging at the end of the transformation Error writing log record to table [t_trans] Unable to clean up old log records from log table t_trans Couldn't execute SQL: DELETE FROM t_trans WHERE LOGDATE < ? Deadlock found when trying to get lock; try restarting transaction at org.pentaho.di.trans.Trans$7.transFinished(Trans.java:1735) at org.pentaho.di.trans.Trans.fireTransFinishedListeners(Trans.java:1033) at org.pentaho.di.trans.Trans$1.stepFinished(Trans.java:861) at org.pentaho.di.trans.step.BaseStep.markStop(BaseStep.java:2314) at org.pentaho.di.trans.step.RunThread.run(RunThread.java:88) at java.lang.Thread.run(Thread.java:662) Caused by: org.pentaho.di.core.exception.KettleException: Error writing log record to table [t_trans] Unable to clean up old log records from log table t_trans Couldn't execute SQL: DELETE FROM t_trans WHERE LOGDATE < ? Deadlock found when trying to get lock; try restarting transaction at org.pentaho.di.trans.Trans.endProcessing(Trans.java:1959) at org.pentaho.di.trans.Trans.access$1400(Trans.java:117) at org.pentaho.di.trans.Trans$7.transFinished(Trans.java:1730) ... 5 more Caused by: org.pentaho.di.core.exception.KettleDatabaseException: Unable to clean up old log records from log table t_trans Couldn't execute SQL: DELETE FROM t_trans WHERE LOGDATE < ? Deadlock found when trying to get lock; try restarting transaction at org.pentaho.di.core.database.Database.cleanupLogRecords(Database.java:3652) at org.pentaho.di.trans.Trans.endProcessing(Trans.java:1950) ... 7 more Caused by: org.pentaho.di.core.exception.KettleDatabaseException: Couldn't execute SQL: DELETE FROM t_trans WHERE LOGDATE < ? Deadlock found when trying to get lock; try restarting transaction at org.pentaho.di.core.database.Database.execStatement(Database.java:1650) at org.pentaho.di.core.database.Database.cleanupLogRecords(Database.java:3645) ... 8 more Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1064) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990) at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1337) at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:825) at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1362) at org.pentaho.di.core.database.Database.execStatement(Database.java:1609) ... 9 more
    via by Thierry Accart,
  • Deadlock with jpaRepository
    via Stack Overflow by Yaniv Hadad
    ,
    • com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[na:1.7.0_67] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)[na:1.7.0_67] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[na:1.7.0_67] at java.lang.reflect.Constructor.newInstance(Constructor.java:526)[na:1.7.0_67] at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)[mysql-connector-java-5.1.30.jar:na] at com.mysql.jdbc.Util.getInstance(Util.java:384)[mysql-connector-java-5.1.30.jar:na] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1064)[mysql-connector-java-5.1.30.jar:na] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4232)[mysql-connector-java-5.1.30.jar:na] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4164)[mysql-connector-java-5.1.30.jar:na] at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)[mysql-connector-java-5.1.30.jar:na] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)[mysql-connector-java-5.1.30.jar:na] at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2838)[mysql-connector-java-5.1.30.jar:na] at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2082)[mysql-connector-java-5.1.30.jar:na] at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1307)[mysql-connector-java-5.1.30.jar:na] at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:2931)[druid-1.0.23.jar:1.0.23] at com.alibaba.druid.wall.WallFilter.preparedStatement_execute(WallFilter.java:600)[druid-1.0.23.jar:1.0.23] at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:2929)[druid-1.0.23.jar:1.0.23] at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440)[druid-1.0.23.jar:1.0.23] at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:2929)[druid-1.0.23.jar:1.0.23] at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440)[druid-1.0.23.jar:1.0.23] at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:2929)[druid-1.0.23.jar:1.0.23] at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:131)[druid-1.0.23.jar:1.0.23] at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:493)[druid-1.0.23.jar:1.0.23] at sun.reflect.GeneratedMethodAccessor90.invoke(Unknown Source)[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.7.0_67] at java.lang.reflect.Method.invoke(Method.java:606)[na:1.7.0_67] at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:62)[mybatis-3.2.7.jar:3.2.7] at com.sun.proxy.$Proxy45.execute(Unknown Source)[na:na] at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:44)[mybatis-3.2.7.jar:3.2.7] at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:69)[mybatis-3.2.7.jar:3.2.7] at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:48)[mybatis-3.2.7.jar:3.2.7] at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:105)[mybatis-3.2.7.jar:3.2.7] at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:71)[mybatis-3.2.7.jar:3.2.7] at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:152)[mybatis-3.2.7.jar:3.2.7] at sun.reflect.GeneratedMethodAccessor174.invoke(Unknown Source)[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.7.0_67] at java.lang.reflect.Method.invoke(Method.java:606)[na:1.7.0_67] at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358)[mybatis-spring-1.2.2.jar:1.2.2] at com.sun.proxy.$Proxy13.update(Unknown Source)[na:na] at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:254)[mybatis-spring-1.2.2.jar:1.2.2] at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:54)[mybatis-3.2.7.jar:3.2.7] at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)[mybatis-3.2.7.jar:3.2.7] at com.sun.proxy.$Proxy48.updateOrderByDescEn(Unknown Source)[na:na] at sun.reflect.GeneratedMethodAccessor565.invoke(Unknown Source)[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.7.0_67] at java.lang.reflect.Method.invoke(Method.java:606)[na:1.7.0_67] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)[spring-aop-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)[spring-aop-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)[spring-aop-4.0.6.RELEASE.jar:4.0.6.RELEASE] at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:72)[druid-1.0.23.jar:1.0.23] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)[spring-aop-4.0.6.RELEASE.jar:4.0.6.RELEASE] at com.sun.proxy.$Proxy49.updateOrderByDescEn(Unknown Source)[na:na] at com.ecms.kms.service.impl.SkuNoHscodeShaServiceImpl.makeTask(SkuNoHscodeShaServiceImpl.java:205)[kms-service-0.0.1-SNAPSHOT.jar:na] at sun.reflect.GeneratedMethodAccessor564.invoke(Unknown Source)[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.7.0_67] at java.lang.reflect.Method.invoke(Method.java:606)[na:1.7.0_67] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)[spring-aop-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)[spring-aop-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)[spring-aop-4.0.6.RELEASE.jar:4.0.6.RELEASE] at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:72)[druid-1.0.23.jar:1.0.23] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)[spring-tx-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)[spring-tx-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)[spring-tx-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)[spring-aop-4.0.6.RELEASE.jar:4.0.6.RELEASE] at com.sun.proxy.$Proxy72.makeTask(Unknown Source)[na:na] at com.ecms.kms.web.mvc.SkuManageController.getNewTask(SkuManageController.java:394)[SkuManageController.class:na] at sun.reflect.GeneratedMethodAccessor579.invoke(Unknown Source)[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.7.0_67] at java.lang.reflect.Method.invoke(Method.java:606)[na:1.7.0_67] at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)[spring-webmvc-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)[spring-webmvc-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)[spring-webmvc-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)[spring-webmvc-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)[spring-webmvc-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)[spring-webmvc-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)[spring-webmvc-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)[spring-webmvc-4.0.6.RELEASE.jar:4.0.6.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)[servlet-api.jar:na] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)[spring-webmvc-4.0.6.RELEASE.jar:4.0.6.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)[servlet-api.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)[catalina.jar:7.0.55] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)[catalina.jar:7.0.55] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)[catalina.jar:7.0.55] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)[catalina.jar:7.0.55] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)[tomcat7-websocket.jar:7.0.55] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)[catalina.jar:7.0.55] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)[catalina.jar:7.0.55] at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)[druid-1.0.23.jar:1.0.23] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)[catalina.jar:7.0.55] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)[catalina.jar:7.0.55] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)[catalina.jar:7.0.55] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)[catalina.jar:7.0.55] at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)[shiro-web-1.2.3.jar:1.2.3] at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)[shiro-web-1.2.3.jar:1.2.3] at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)[shiro-web-1.2.3.jar:1.2.3] at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)[shiro-web-1.2.3.jar:1.2.3] at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)[shiro-web-1.2.3.jar:1.2.3] at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)[shiro-web-1.2.3.jar:1.2.3] at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)[shiro-web-1.2.3.jar:1.2.3] at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)[shiro-core-1.2.3.jar:1.2.3] at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)[shiro-core-1.2.3.jar:1.2.3] at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)[shiro-core-1.2.3.jar:1.2.3] at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)[shiro-web-1.2.3.jar:1.2.3] at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)[shiro-web-1.2.3.jar:1.2.3] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)[catalina.jar:7.0.55] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)[catalina.jar:7.0.55] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)[catalina.jar:7.0.55] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)[catalina.jar:7.0.55] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)[catalina.jar:7.0.55] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)[catalina.jar:7.0.55] at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)[catalina.jar:7.0.55] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)[catalina.jar:7.0.55] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)[catalina.jar:7.0.55] at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)[tomcat-coyote.jar:7.0.55] at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)[tomcat-coyote.jar:7.0.55] at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)[tomcat-coyote.jar:7.0.55] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[na:1.7.0_67] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[na:1.7.0_67] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)[tomcat-coyote.jar:7.0.55] at java.lang.Thread.run(Thread.java:745)[na:1.7.0_67]

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    3 more bugmates