When to increase lockTimeinMillis or waitTimeInMillis

Hi guys,

I got this error, and it seems it went away when I incresased waitTimeInMillis from 8000 to 60000, But the error talks about lock time… Could you please explain some hints on how to set these values, which are their typical values and the good practices to tune them?

Thanks in advance
Alfonso

Here is the stacktrace:

`12` `:` `14` `:` `43` `,` `452`   `ERROR [es.gc.epsilon.core.api.utils.interceptor.ExceptionMapperHandler] (https-executor-threads - ` `1` `) ERROR: Caused by: org.camunda.bpm.engine.ProcessEngineException: ENGINE-` `03083`   `Exception ` `while`   `executing Batch Database Operations with message '`

`### Error flushing statements.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.insertVariableInstance (batch index #` `8` `) failed. ` `7`   `prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Lock wait timeout exceeded; ` `try`   `restarting transaction`

`### Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.insertVariableInstance (batch index #` `8` `) failed. ` `7`   `prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Lock wait timeout exceeded; ` `try`   `restarting transaction`

`java.sql.BatchUpdateException: Lock wait timeout exceeded; ` `try`   `restarting transaction`

`java.sql.SQLException: Lock wait timeout exceeded; ` `try`   `restarting transaction`

`'. Flush summary:`

` ` `[`

`  ` `INSERT HistoricVariableInstanceEntity[1011026b-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[1011026c-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[1011026d-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[1011026e-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[1011026f-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[` `10110270` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[` `10110271` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[` `10110272` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[` `10110274` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[` `10110275` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricTaskInstanceEventEntity[102b8ea0-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricProcessInstanceEventEntity[1010db59-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricActivityInstanceEventEntity[miProcessStarted:` `10110276` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricActivityInstanceEventEntity[tskReviewRecruiting:101177a9-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT ExecutionEntity[1010db59-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT TaskEntity[102b8ea0-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT ByteArrayEntity[1011026a-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT ByteArrayEntity[` `10110273` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT ByteArrayEntity[` `10112987` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT ByteArrayEntity[` `10112988` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[1011026b-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[1011026c-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[1011026d-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[1011026e-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[1011026f-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[` `10110270` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[` `10110271` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[` `10110272` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[` `10110274` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[` `10110275` `-22f6-11e9-b8a2-8416f905c9a2]`

`] at org.camunda.bpm.engine.ProcessEngineException: ENGINE-` `03083`   `Exception ` `while`   `executing Batch Database Operations with message '`

`### Error flushing statements.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.insertVariableInstance (batch index #` `8` `) failed. ` `7`   `prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Lock wait timeout exceeded; ` `try`   `restarting transaction`

`### Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.insertVariableInstance (batch index #` `8` `) failed. ` `7`   `prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Lock wait timeout exceeded; ` `try`   `restarting transaction`

`java.sql.BatchUpdateException: Lock wait timeout exceeded; ` `try`   `restarting transaction`

`java.sql.SQLException: Lock wait timeout exceeded; ` `try`   `restarting transaction`

`'. Flush summary:`

` ` `[`

`  ` `INSERT HistoricVariableInstanceEntity[1011026b-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[1011026c-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[1011026d-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[1011026e-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[1011026f-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[` `10110270` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[` `10110271` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[` `10110272` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[` `10110274` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricVariableInstanceEntity[` `10110275` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricTaskInstanceEventEntity[102b8ea0-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricProcessInstanceEventEntity[1010db59-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricActivityInstanceEventEntity[miProcessStarted:` `10110276` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT HistoricActivityInstanceEventEntity[tskReviewRecruiting:101177a9-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT ExecutionEntity[1010db59-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT TaskEntity[102b8ea0-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT ByteArrayEntity[1011026a-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT ByteArrayEntity[` `10110273` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT ByteArrayEntity[` `10112987` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT ByteArrayEntity[` `10112988` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[1011026b-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[1011026c-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[1011026d-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[1011026e-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[1011026f-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[` `10110270` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[` `10110271` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[` `10110272` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[` `10110274` `-22f6-11e9-b8a2-8416f905c9a2]`

`  ` `INSERT VariableInstanceEntity[` `10110275` `-22f6-11e9-b8a2-8416f905c9a2]`

`]`

`    ` `at org.camunda.bpm.engine.impl.db.EnginePersistenceLogger.flushDbOperationsException(EnginePersistenceLogger.java:` `689` `)`

`    ` `at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperations(DbEntityManager.java:` `343` `)`

`    ` `at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperationManager(DbEntityManager.java:` `314` `)`

`    ` `at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flush(DbEntityManager.java:` `286` `)`

`    ` `at org.camunda.bpm.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:` `203` `)`

`    ` `at org.camunda.bpm.engine.impl.interceptor.CommandContext.close(CommandContext.java:` `132` `)`

`    ` `at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:` `113` `)`

`    ` `at org.camunda.bpm.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:` `58` `)`

`    ` `at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:` `66` `)`

`    ` `at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:` `30` `)`

`    ` `at org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl.executeWithVariablesInReturn(ProcessInstantiationBuilderImpl.java:` `162` `)`

`    ` `at org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl.execute(ProcessInstantiationBuilderImpl.java:` `128` `)`

`    ` `at org.camunda.bpm.engine.impl.ProcessInstantiationBuilderImpl.execute(ProcessInstantiationBuilderImpl.java:` `124` `)`

`    ` `at org.camunda.bpm.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:` `100` `)`

`    ` `at sun.reflect.GeneratedMethodAccessor14593.invoke(Unknown Source)`

`    ` `at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:` `43` `)`

`    ` `at java.lang.reflect.Method.invoke(Method.java:` `606` `)`

`    ` `at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:` `45` `)`

`    ` `at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:` `105` `)`

`    ` `at org.jboss.weld.proxies.RuntimeService$` `333951491` `$Proxy$_$_WeldClientProxy.startProcessInstanceByKey(RuntimeService$` `333951491` `$Proxy$_$_WeldClientProxy.java)`

`    ` `at es.gc.epsilon.core.api.processes.manager.ProcessActionBaseManagerImpl.start(ProcessActionBaseManagerImpl.java:` `230` `)`

`    ` `at sun.reflect.GeneratedMethodAccessor5656.invoke(Unknown Source)`

`    ` `at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:` `43` `)`

`    ` `at java.lang.reflect.Method.invoke(Method.java:` `606` `)`

`    ` `at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:` `52` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:` `53` `)`

`    ` `at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$` `1` `.processInvocation(UserInterceptorFactory.java:` `63` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:` `374` `)`

`    ` `at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:` `86` `)`

`    ` `at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:` `97` `)`

`    ` `at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$` `1` `.processInvocation(UserInterceptorFactory.java:` `63` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:` `374` `)`

`    ` `at es.gc.epsilon.core.api.utils.interceptor.AuditReadInterceptor.auditRead(AuditReadInterceptor.java:` `19` `)`

`    ` `at sun.reflect.GeneratedMethodAccessor368.invoke(Unknown Source)`

`    ` `at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:` `43` `)`

`    ` `at java.lang.reflect.Method.invoke(Method.java:` `606` `)`

`    ` `at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:` `89` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:` `53` `)`

`    ` `at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$` `1` `.processInvocation(UserInterceptorFactory.java:` `63` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:` `49` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:` `47` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:` `73` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:` `21` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:` `61` `)`

`    ` `at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:` `53` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:` `51` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:` `272` `)`

`    ` `at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:` `339` `)`

`    ` `at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:` `238` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:` `41` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$` `1` `.processInvocation(ShutDownInterceptorFactory.java:` `64` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:` `59` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:` `50` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:` `55` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:` `45` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:` `61` `)`

`    ` `at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:` `185` `)`

`    ` `at org.jboss.as.ee.component.ViewDescription$` `1` `.processInvocation(ViewDescription.java:` `182` `)`

`    ` `at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:` `288` `)`

`    ` `at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:` `61` `)`

`    ` `at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:` `73` `)`

`    ` `at es.gc.epsilon.core.api.processes.spain.manager.RecruitingManager$$view346.start(Unknown Source)`

`    ` `at sun.reflect.GeneratedMethodAccessor14586.invoke(Unknown Source)`

`    ` `at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:` `43` `)`

`    ` `at java.lang.reflect.Method.invoke(Method.java:` `606` `)`

`    ` `at org.jboss.weld.util.reflection.SecureReflections$` `13` `.work(SecureReflections.java:` `267` `)`

`    ` `at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:` `52` `)`

`    ` `at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:` `137` `)`

`    ` `at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:` `263` `)`

`    ` `at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:` `115` `)`

`    ` `at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:` `56` `)`

`    ` `at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:` `105` `)`

`    ` `at es.gc.epsilon.core.api.processes.spain.manager.ProcessActionManager$ProcessManager$RecruitingManager$TasksBaseManager$-` `766396636` `$Proxy$_$_Weld$Proxy$.start(ProcessActionManager$ProcessManager$RecruitingManager$TasksBaseManager$-` `766396636` `$Proxy$_$_Weld$Proxy$.java)`

`    ` `at es.gc.epsilon.core.api.processes.EpsilonProcessServiceImpl.start(EpsilonProcessServiceImpl.java:` `148` `)`

`    ` `at es.gc.epsilon.core.api.processes.spain.RecruitingServiceImpl$Proxy$_$_WeldClientProxy.start(RecruitingServiceImpl$Proxy$_$_WeldClientProxy.java)`

`    ` `at sun.reflect.GeneratedMethodAccessor5658.invoke(Unknown Source)`

`    ` `at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:` `43` `)`

`    ` `at java.lang.reflect.Method.invoke(Method.java:` `606` `)`

`    ` `at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:` `137` `)`

`    ` `at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:` `280` `)`

`    ` `at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:` `234` `)`

`    ` `at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:` `221` `)`

`    ` `at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:` `356` `)`

`    ` `at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:` `179` `)`

`    ` `at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:` `220` `)`

`    ` `at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:` `56` `)`

`    ` `at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:` `51` `)`

`    ` `at javax.servlet.http.HttpServlet.service(HttpServlet.java:` `847` `)`

`    ` `at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:` `295` `)`

`    ` `at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:` `214` `)`

`    ` `at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:` `52` `)`

`    ` `at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:` `246` `)`

`    ` `at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:` `214` `)`

`    ` `at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:` `231` `)`

`    ` `at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:` `149` `)`

`    ` `at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:` `50` `)`

`    ` `at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:` `50` `)`

`    ` `at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:` `512` `)`

`    ` `at org.jboss.resteasy.skeleton.key.as7.BearerTokenAuthenticatorValve.invoke(BearerTokenAuthenticatorValve.java:` `63` `)`

`    ` `at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:` `169` `)`

`    ` `at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:` `145` `)`

`    ` `at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:` `97` `)`

`    ` `at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:` `102` `)`

`    ` `at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:` `344` `)`

`    ` `at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:` `876` `)`

`    ` `at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:` `607` `)`

`    ` `at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:` `2536` `)`

`    ` `at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:` `33` `)`

`    ` `at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:` `808` `)`

`    ` `at org.jboss.threads.QueueExecutor.access$` `100` `(QueueExecutor.java:` `45` `)`

`    ` `at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:` `849` `)`

`    ` `at java.lang.Thread.run(Thread.java:` `724` `)`

`    ` `at org.jboss.threads.JBossThread.run(JBossThread.java:` `122` `)`

`Caused by: org.apache.ibatis.exceptions.PersistenceException:`

`### Error flushing statements.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.insertVariableInstance (batch index #` `8` `) failed. ` `7`   `prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Lock wait timeout exceeded; ` `try`   `restarting transaction`

`### Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.insertVariableInstance (batch index #` `8` `) failed. ` `7`   `prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Lock wait timeout exceeded; ` `try`   `restarting transaction`

`    ` `at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:` `30` `)`

`    ` `at org.apache.ibatis.session.defaults.DefaultSqlSession.flushStatements(DefaultSqlSession.java:` `255` `)`

`    ` `at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.flushOperations(DbSqlSession.java:` `88` `)`

`    ` `at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperations(DbEntityManager.java:` `341` `)`

`    ` `... ` `129`   `more`

`Caused by: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.insertVariableInstance (batch index #` `8` `) failed. ` `7`   `prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Lock wait timeout exceeded; ` `try`   `restarting transaction`

`    ` `at org.apache.ibatis.executor.BatchExecutor.doFlushStatements(BatchExecutor.java:` `146` `)`

`    ` `at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:` `129` `)`

`    ` `at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:` `122` `)`

`    ` `at org.apache.ibatis.executor.CachingExecutor.flushStatements(CachingExecutor.java:` `114` `)`

`    ` `at org.apache.ibatis.session.defaults.DefaultSqlSession.flushStatements(DefaultSqlSession.java:` `253` `)`

`    ` `... ` `131`   `more`

`Caused by: java.sql.BatchUpdateException: Lock wait timeout exceeded; ` `try`   `restarting transaction`

Which database are you using?

If you are using MySQL database make sure isolation level is READ_COMMITTED to avoid unnecessary deadlocks.

lockTime should be increased for long running processes. To increase lockTime execute below query in database.

SET GLOBAL innodb_lock_wait_timeout = 120;

1 Like