Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-1481

Duplicate PK exception for SessoinLogEntry (isisaddons implementation of SessionLoggingService) due to race condition.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.13.0
    • 1.13.1
    • Core
    • None

    Description

      for example:

      java.sql.BatchUpdateException: Violation of PRIMARY KEY constraint 'SessionLogEntry_PK'. Cannot insert duplicate key in object 'isissessionlogger.SessionLogEntry'. The duplicate key value is (1379530416).
              at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:543)
              at org.datanucleus.api.jdo.JDOPersistenceManager.flush(JDOPersistenceManager.java:2070)
              at org.apache.isis.core.runtime.system.persistence.PersistenceSession.executeCommands(PersistenceSession.java:1255)
              at org.apache.isis.core.runtime.system.persistence.PersistenceSession.execute(PersistenceSession.java:1247)
              at org.apache.isis.core.runtime.system.transaction.IsisTransaction.doFlush(IsisTransaction.java:378)
              at org.apache.isis.core.runtime.system.transaction.IsisTransaction.preCommit(IsisTransaction.java:419)
              at org.apache.isis.core.runtime.system.transaction.IsisTransactionManager.endTransaction(IsisTransactionManager.java:344)
              at org.apache.isis.core.runtime.system.transaction.IsisTransactionManager.executeWithinTransaction(IsisTransactionManager.java:145)
              at org.apache.isis.core.runtime.system.transaction.IsisTransactionManager.executeWithinTransaction(IsisTransactionManager.java:133)
              at org.apache.isis.core.runtime.system.persistence.PersistenceSession.makePersistentInTransaction(PersistenceSession.java:1102)
              at org.apache.isis.core.runtime.services.persistsession.PersistenceSessionServiceInternalDefault.makePersistent(PersistenceSessionServiceInternalDefault.java:83)
              at org.apache.isis.core.metamodel.services.repository.RepositoryServiceInternalDefault.persist(RepositoryServiceInternalDefault.java:96)
              at org.apache.isis.core.metamodel.services.container.DomainObjectContainerDefault.persistIfNotAlready(DomainObjectContainerDefault.java:365)
              at org.apache.isis.applib.AbstractContainedObject.persistIfNotAlready(AbstractContainedObject.java:574)
              at org.isisaddons.module.sessionlogger.dom.SessionLoggingServiceDefault.log(SessionLoggingServiceDefault.java:42)
              at org.apache.isis.viewer.wicket.viewer.integration.wicket.AuthenticatedWebSessionForIsis$1.run(AuthenticatedWebSessionForIsis.java:180)
              at org.apache.isis.core.runtime.system.session.IsisSessionFactory$1.call(IsisSessionFactory.java:316)
              at org.apache.isis.core.runtime.system.session.IsisSessionFactory$1.call(IsisSessionFactory.java:313)
              at org.apache.isis.core.runtime.system.session.IsisSessionFactory.doInSession(IsisSessionFactory.java:347)
              ... 60 more
      
      
      sessionId causedBy loginTimestamp logoutTimestamp user
      1379530416 NULL 2016-09-07 10:14:47.5690000 NULL enicoletti@ecp.loc

      Here's some more:

      11:46:37,702 [WebRequestCycleForIsis        ] Unable to obtain exceptionRecognizers (no session), will be treated as unrecognized exception
      org.apache.wicket.protocol.http.PageExpiredException: Page with id '8' has expired.
      11:48:11,808 [PersistenceSession            ] close: failed to close JDO persistenceManager; continuing to avoid memory leakage
      07-Sep-2016 11:48:09.973 WARNING [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.StandardContext.backgroundProcess Exception processing manager org.apache.catalina.session.StandardManager[/estatioprod] background process
       java.lang.IllegalStateException: No service of type class org.apache.isis.applib.services.command.CommandContext is available on this
              at org.apache.isis.core.runtime.services.ServiceInstantiator$2.invoke(ServiceInstantiator.java:217)
              at org.apache.isis.applib.services.command.CommandContext_$$_jvst9b7_2.getCommand(CommandContext_$$_jvst9b7_2.java)
              at org.apache.isis.core.runtime.system.persistence.PersistenceSession.completeCommandFromInteractionAndClearDomainEvents(PersistenceSession.java:483)
              at org.apache.isis.core.runtime.system.persistence.PersistenceSession.close(PersistenceSession.java:414)
              at org.apache.isis.core.runtime.system.session.IsisSession.close(IsisSession.java:69)
              at org.apache.isis.core.runtime.system.session.IsisSessionFactory.closeSession(IsisSessionFactory.java:263)
              at org.apache.isis.core.runtime.system.session.IsisSessionFactory.doInSession(IsisSessionFactory.java:354)
              at org.apache.isis.core.runtime.system.session.IsisSessionFactory.doInSession(IsisSessionFactory.java:327)
              at org.apache.isis.viewer.wicket.viewer.integration.wicket.AuthenticatedWebSessionForIsis.getSessionLoggingService(AuthenticatedWebSessionForIsis.java:187)
              at org.apache.isis.viewer.wicket.viewer.integration.wicket.AuthenticatedWebSessionForIsis.log(AuthenticatedWebSessionForIsis.java:173)
              at org.apache.isis.viewer.wicket.viewer.integration.wicket.AuthenticatedWebSessionForIsis.onInvalidate(AuthenticatedWebSessionForIsis.java:120)
              at org.apache.wicket.session.HttpSessionStore$SessionBindingListener.valueUnbound(HttpSessionStore.java:471)
              at org.apache.catalina.session.StandardSession.removeAttributeInternal(StandardSession.java:1838)
              at org.apache.catalina.session.StandardSession.expire(StandardSession.java:891)
              at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:694)
              at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:666)
              at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:651)
              at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5625)
              at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1377)
              at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1381)
              at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1381)
              at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1349)
              at java.lang.Thread.run(Thread.java:745)
      

      Attachments

        Activity

          People

            danhaywood Daniel Keir Haywood
            danhaywood Daniel Keir Haywood
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: