Mirth Connect
  1. Mirth Connect
  2. MIRTH-4253

Intermittent deadlock with Derby while vacuuming tables

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.0, 3.5.1
    • Fix Version/s: 3.6.0, 3.5.2
    • Component/s: Server
    • Labels:
      None

      Description

      ERROR 2017-11-02 15:05:54,118 [qtp25398838-21] com.mirth.connect.server.controllers.DefaultConfigurationController: Could not retrieve properties: category=User Authorization
      org.apache.ibatis.exceptions.PersistenceException: 
      ### Error querying database.  Cause: java.sql.SQLTransactionRollbackException: A lock could not be obtained due to a deadlock, cycle of locks and waiters is:
      Lock : TABLE, CONFIGURATION, Tablelock
        Waiting XID : {16140, IS} , APP, SELECT NAME AS "key", VALUE AS "value"
      		FROM CONFIGURATION
      		WHERE CATEGORY = ?
        Granted XID : {16129, X} 
      Lock : ROW, SYSCONGLOMERATES, (7,16)
        Waiting XID : {16129, X} , APP, alter table "APP"."CONFIGURATION" compress
        Granted XID : {16129, S} , {16140, S} 
      . The selected victim is XID : 16140.
      ### The error may exist in derby/derby-configuration.xml
      ### The error may involve Configuration.selectPropertiesForCategory
      ### The error occurred while executing a query
      ### SQL: SELECT NAME AS "key", VALUE AS "value"   FROM CONFIGURATION   WHERE CATEGORY = ?
      ### Cause: java.sql.SQLTransactionRollbackException: A lock could not be obtained due to a deadlock, cycle of locks and waiters is:
      Lock : TABLE, CONFIGURATION, Tablelock
        Waiting XID : {16140, IS} , APP, SELECT NAME AS "key", VALUE AS "value"
      		FROM CONFIGURATION
      		WHERE CATEGORY = ?
        Granted XID : {16129, X} 
      Lock : ROW, SYSCONGLOMERATES, (7,16)
        Waiting XID : {16129, X} , APP, alter table "APP"."CONFIGURATION" compress
        Granted XID : {16129, S} , {16140, S} 
      . The selected victim is XID : 16140.
      	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
      	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104)
      	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:95)
      	at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.apache.ibatis.session.SqlSessionManager$SqlSessionInterceptor.invoke(SqlSessionManager.java:282)
      	at com.sun.proxy.$Proxy6.selectList(Unknown Source)
      	at org.apache.ibatis.session.SqlSessionManager.selectList(SqlSessionManager.java:171)
      	at com.mirth.connect.server.controllers.DefaultConfigurationController.getPropertiesForGroup(DefaultConfigurationController.java:861)
      	at com.mirth.connect.server.controllers.DefaultExtensionController.getPluginProperties(DefaultExtensionController.java:621)
      	at com.mirth.connect.plugins.auth.server.SecureAuthorizationController.getUserRoles(Unknown Source)
      	at com.mirth.connect.plugins.auth.server.SecureAuthorizationController.doesUserHaveChannelRestrictions(Unknown Source)
      	at com.mirth.connect.server.api.MirthServlet.setContext(MirthServlet.java:165)
      	at com.mirth.connect.server.api.MirthServlet.initLogin(MirthServlet.java:96)
      	at com.mirth.connect.server.api.MirthServlet.<init>(MirthServlet.java:87)
      	at com.mirth.connect.server.api.MirthServlet.<init>(MirthServlet.java:74)
      	at com.mirth.connect.server.api.MirthServlet.<init>(MirthServlet.java:70)
      	at com.mirth.connect.server.api.servlets.ChannelServlet.<init>(ChannelServlet.java:49)
      	at sun.reflect.GeneratedConstructorAccessor160.newInstance(Unknown Source)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      	at org.glassfish.hk2.utilities.reflection.ReflectionHelper.makeMe(ReflectionHelper.java:1350)
      	at org.jvnet.hk2.internal.ClazzCreator.createMe(ClazzCreator.java:271)
      	at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:365)
      	at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:471)
      	at org.glassfish.jersey.process.internal.RequestScope.findOrCreate(RequestScope.java:162)
      	at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2072)
      	at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetService(ServiceLocatorImpl.java:767)
      	at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:706)
      	at org.glassfish.jersey.internal.inject.Injections.getOrCreate(Injections.java:172)
      	at org.glassfish.jersey.server.model.MethodHandler$ClassBasedMethodHandler.getInstance(MethodHandler.java:284)
      	at org.glassfish.jersey.server.internal.routing.PushMethodHandlerRouter.apply(PushMethodHandlerRouter.java:74)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:109)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:92)
      	at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:61)
      	at org.glassfish.jersey.process.internal.Stages.process(Stages.java:197)
      	at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:318)
      	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
      	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
      	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
      	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
      	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
      	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:471)
      	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:425)
      	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:383)
      	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:336)
      	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:223)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1712)
      	at com.mirth.connect.server.MethodFilter.doFilter(MethodFilter.java:37)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1699)
      	at com.mirth.connect.server.api.providers.ClickjackingFilter.doFilter(ClickjackingFilter.java:44)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1699)
      	at com.mirth.connect.server.api.providers.ApiOriginFilter.doFilter(ApiOriginFilter.java:71)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1699)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
      	at org.eclipse.jetty.server.Server.handle(Server.java:534)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
      	at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:202)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
      	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
      	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
      	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
      	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: java.sql.SQLTransactionRollbackException: A lock could not be obtained due to a deadlock, cycle of locks and waiters is:
      Lock : TABLE, CONFIGURATION, Tablelock
        Waiting XID : {16140, IS} , APP, SELECT NAME AS "key", VALUE AS "value"
      		FROM CONFIGURATION
      		WHERE CATEGORY = ?
        Granted XID : {16129, X} 
      Lock : ROW, SYSCONGLOMERATES, (7,16)
        Waiting XID : {16129, X} , APP, alter table "APP"."CONFIGURATION" compress
        Granted XID : {16129, S} , {16140, S} 
      . The selected victim is XID : 16140.
      	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
      	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
      	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
      	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
      	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
      	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
      	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
      	at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
      	at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
      	at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
      	at org.apache.derby.impl.jdbc.EmbedPreparedStatement42.<init>(Unknown Source)
      	at org.apache.derby.jdbc.Driver42.newEmbedPreparedStatement(Unknown Source)
      	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
      	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
      	at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.apache.ibatis.datasource.pooled.PooledConnection.invoke(PooledConnection.java:246)
      	at com.sun.proxy.$Proxy7.prepareStatement(Unknown Source)
      	at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:72)
      	at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:82)
      	at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:54)
      	at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:70)
      	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:56)
      	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267)
      	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:141)
      	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105)
      	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81)
      	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:101)
      	... 85 more
      Caused by: java.sql.SQLException: A lock could not be obtained due to a deadlock, cycle of locks and waiters is:
      Lock : TABLE, CONFIGURATION, Tablelock
        Waiting XID : {16140, IS} , APP, SELECT NAME AS "key", VALUE AS "value"
      		FROM CONFIGURATION
      		WHERE CATEGORY = ?
        Granted XID : {16129, X} 
      Lock : ROW, SYSCONGLOMERATES, (7,16)
        Waiting XID : {16129, X} , APP, alter table "APP"."CONFIGURATION" compress
        Granted XID : {16129, S} , {16140, S} 
      . The selected victim is XID : 16140.
      	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
      	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
      	... 114 more
      Caused by: ERROR 40001: A lock could not be obtained due to a deadlock, cycle of locks and waiters is:
      Lock : TABLE, CONFIGURATION, Tablelock
        Waiting XID : {16140, IS} , APP, SELECT NAME AS "key", VALUE AS "value"
      		FROM CONFIGURATION
      		WHERE CATEGORY = ?
        Granted XID : {16129, X} 
      Lock : ROW, SYSCONGLOMERATES, (7,16)
        Waiting XID : {16129, X} , APP, alter table "APP"."CONFIGURATION" compress
        Granted XID : {16129, S} , {16140, S} 
      . The selected victim is XID : 16140.
      	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
      	at org.apache.derby.impl.services.locks.Deadlock.buildException(Unknown Source)
      	at org.apache.derby.impl.services.locks.ConcurrentLockSet.lockObject(Unknown Source)
      	at org.apache.derby.impl.services.locks.AbstractPool.lockObject(Unknown Source)
      	at org.apache.derby.impl.services.locks.ConcurrentPool.lockObject(Unknown Source)
      	at org.apache.derby.impl.store.raw.xact.RowLocking2.lockContainer(Unknown Source)
      	at org.apache.derby.impl.store.raw.data.BaseContainerHandle.useContainer(Unknown Source)
      	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown Source)
      	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown Source)
      	at org.apache.derby.impl.store.raw.xact.Xact.openContainer(Unknown Source)
      	at org.apache.derby.impl.store.access.conglomerate.OpenConglomerate.init(Unknown Source)
      	at org.apache.derby.impl.store.access.heap.Heap.open(Unknown Source)
      	at org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(Unknown Source)
      	at org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(Unknown Source)
      	at org.apache.derby.impl.sql.compile.ResultColumnList.newRowLocationTemplate(Unknown Source)
      	at org.apache.derby.impl.sql.compile.ResultColumnList.buildRowTemplate(Unknown Source)
      	at org.apache.derby.impl.sql.compile.FromBaseTable.getScanArguments(Unknown Source)
      	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(Unknown Source)
      	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(Unknown Source)
      	at org.apache.derby.impl.sql.compile.IndexToBaseRowNode.generate(Unknown Source)
      	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(Unknown Source)
      	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(Unknown Source)
      	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(Unknown Source)
      	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(Unknown Source)
      	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(Unknown Source)
      	at org.apache.derby.impl.sql.compile.CursorNode.generate(Unknown Source)
      	at org.apache.derby.impl.sql.compile.StatementNode.generate(Unknown Source)
      	at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
      	at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
      	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
      	... 108 more
      ERROR 2017-11-02 15:05:54,126 [qtp25398838-21] com.mirth.connect.model.converters.ObjectXMLSerializer: com.mirth.connect.donkey.util.DonkeyElement$DonkeyElementException: java.lang.NullPointerException
      

      See:

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Nick Rupley
            Reporter:
            Nick Rupley
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development