Hello,
H2 v1.3.175
URL:
jdbc:h2:mem:queries_db;CACHE_SIZE=32768;DATABASE_TO_UPPER=false;IGNORECASE=false;DB_CLOSE_DELAY=-1;MULTI_THREADED=1;LOCK_TIMEOUT=10000;LOG=0;UNDO_LOG=0;JMX=TRUE
I's embedded database with in-memory tables only (table per request). After
table is created multiple threads are writing data into it. Then multiple
SQL queries are run against the table. At the and of request I delete the
table.
I'm continuously getting timeouts (Timeout trying to lock table "SYS") when
trying to create new table under load (even insignificant).
Any help will be highly appreciated.
ERROR [22 Sep 2014 06:57:39,648]:MON:ba08a990-59d8-4e7e-a0f1-baba3264ea24
REQUEST ABORTED BECAUSE OF EXCEPTION
java.util.concurrent.ExecutionException:
org.springframework.dao.CannotAcquireLockException: StatementCallback; SQL
[CREATE MEMORY TABLE IF NOT EXISTS
TABLE_6f4109dace7a4b208949c570d841a485(account_id BIGINT, pop VARCHAR, time
BIGINT) NOT PERSISTENT]; Timeout trying to lock table "SYS"; SQL statement:
CREATE MEMORY TABLE IF NOT EXISTS
TABLE_6f4109dace7a4b208949c570d841a485(account_id BIGINT, pop VARCHAR, time
BIGINT) NOT PERSISTENT [50200-175]; nested exception is
org.h2.jdbc.JdbcSQLException: Timeout trying to lock table "SYS"; SQL
statement:
CREATE MEMORY TABLE IF NOT EXISTS
TABLE_6f4109dace7a4b208949c570d841a485(account_id BIGINT, pop VARCHAR, time
BIGINT) NOT PERSISTENT [50200-175]
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:232)
at java.util.concurrent.FutureTask.get(FutureTask.java:91)
at
com.company.project.reports.api.controller.QueryDataController.getQueryData(QueryDataController.java:85)
at sun.reflect.GeneratedMethodAccessor81.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
at
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:439)
at
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:427)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:915)
at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:811)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:796)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.company.project.reports.api.filter.LoggingMDCServletFilter.doFilterInternal(LoggingMDCServletFilter.java:28)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at
com.company.project.reports.api.security.SimpleAuthenticationFilter.doFilterInternal(SimpleAuthenticationFilter.java:68)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.company.project.reports.api.filter.RetryPolicyMarkerFilter.doFilterInternal(RetryPolicyMarkerFilter.java:31)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.company.project.reports.api.filter.AcceptHeaderFilter.doFilterInternal(AcceptHeaderFilter.java:63)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.company.project.reports.api.filter.PayloadCachingRequestFilter.doFilterInternal(PayloadCachingRequestFilter.java:26)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:227)
at
org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705)
at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.springframework.dao.CannotAcquireLockException:
StatementCallback; SQL [CREATE MEMORY TABLE IF NOT EXISTS
TABLE_6f4109dace7a4b208949c570d841a485(account_id BIGINT, pop VARCHAR, time
BIGINT) NOT PERSISTENT]; Timeout trying to lock table "SYS"; SQL statement:
CREATE MEMORY TABLE IF NOT EXISTS
TABLE_6f4109dace7a4b208949c570d841a485(account_id BIGINT, pop VARCHAR, time
BIGINT) NOT PERSISTENT [50200-175]; nested exception is
org.h2.jdbc.JdbcSQLException: Timeout trying to lock table "SYS"; SQL
statement:
CREATE MEMORY TABLE IF NOT EXISTS
TABLE_6f4109dace7a4b208949c570d841a485(account_id BIGINT, pop VARCHAR, time
BIGINT) NOT PERSISTENT [50200-175]
at
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:261)
at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:407)
at
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:428)
at
com.company.project.reports.api.memdb.InMemoryStoreH2.createTable(InMemoryStoreH2.java:100)
at sun.reflect.GeneratedMethodAccessor88.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy46.createTable(Unknown Source)
at
com.company.project.reports.api.service.impl.MongoDataServiceImpl.getData(MongoDataServiceImpl.java:96)
at sun.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at
org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
at
com.company.project.reports.api.monitoring.PerformanceMonitoringAspect.monitorInvocation(PerformanceMonitoringAspect.java:27)
at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
at
org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at
org.springframework.cache.interceptor.CacheInterceptor$1.invoke(CacheInterceptor.java:58)
at
org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:213)
at
org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:66)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy71.getData(Unknown Source)
at
com.company.project.reports.api.service.impl.QueryDataServiceImpl.getData(QueryDataServiceImpl.java:73)
at
com.company.project.reports.api.controller.QueryDataController.getQueryData(QueryDataController.java:109)
at
com.company.project.reports.api.controller.QueryDataController.access$100(QueryDataController.java:38)
at
com.company.project.reports.api.controller.QueryDataController$2.doCall(QueryDataController.java:82)
at
com.company.project.reports.api.controller.QueryDataController$2.doCall(QueryDataController.java:79)
at
com.company.project.util.concurrent.ThreadLocalAwareCallable.call(ThreadLocalAwareCallable.java:20)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
... 1 more
Caused by: org.h2.jdbc.JdbcSQLException: Timeout trying to lock table
"SYS"; SQL statement:
CREATE MEMORY TABLE IF NOT EXISTS
TABLE_6f4109dace7a4b208949c570d841a485(account_id BIGINT, pop VARCHAR, time
BIGINT) NOT PERSISTENT [50200-175]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:332)
at org.h2.message.DbException.get(DbException.java:172)
at org.h2.message.DbException.get(DbException.java:149)
at org.h2.table.RegularTable.doLock(RegularTable.java:516)
at org.h2.table.RegularTable.lock(RegularTable.java:450)
at org.h2.engine.Database.lockMeta(Database.java:833)
at org.h2.command.ddl.CreateTable.update(CreateTable.java:133)
at org.h2.command.CommandContainer.update(CommandContainer.java:79)
at org.h2.command.Command.executeUpdate(Command.java:253)
at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:181)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:156)
at
org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
at
org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
at
org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:421)
at
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:396)
... 49 more
--
The information in this message may be confidential. It is intended solely
for
the addressee(s). If you are not the intended recipient, any disclosure,
copying or distribution of the message, or any action or omission taken by
you
in reliance on it, is prohibited and may be unlawful. Please immediately
contact the sender if you have received this message in error.
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.