Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-1941

RS concurrent update of identity for last login

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.5
    • Component/s: None
    • Labels:
      None

      Description

      The current mechanism use "select for update" but a better way found be setting the lastLogin field as not updatable on the main mapping, create a second mapping only to update the last login field. The update statement would not increment the version number and not generate such exception.

      2016-03-13 22:19:48,138 [ajp-nio2-8003-exec-10] ERROR OLATRuntimeException - OLAT::ERROR ^%^ N3-E1 ^%^ org.olat.core.logging
      https://xyz.olat.com/dmz/ ^%^ Mozilla/5.0 (iPhone; CPU iPhone OS 9_2_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13D15 Safari/601.1
      **RedScreen** Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [org.olat.basesecurity.IdentityImpl#279347237]
      >>> stack of 1.cause::org.olat.core.logging.OLATRuntimeException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [org.olat.basesecurity.IdentityImpl#279347237]
      -> at org.olat.core.gui.exception.ExceptionWindowController.<init>(ExceptionWindowController.java:116)
         at org.olat.core.gui.exception.MsgFactory.createMessageChiefController(MsgFactory.java:57)
         at org.olat.core.gui.exception.MsgFactory.createMessageChiefController(MsgFactory.java:46)
         at org.olat.dispatcher.DMZDispatcher.execute(DMZDispatcher.java:280)
         at org.olat.core.servlets.OpenOLATServlet.executeUserRequest(OpenOLATServlet.java:289)
         at org.olat.core.servlets.OpenOLATServlet.doPost(OpenOLATServlet.java:232)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
         at org.olat.core.servlets.OpenOLATServlet.service(OpenOLATServlet.java:175)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      >>> stack of 2.cause::javax.persistence.OptimisticLockException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [org.olat.basesecurity.IdentityImpl#279347237]
      -> at org.hibernate.jpa.spi.AbstractEntityManagerImpl.wrapStaleStateException(AbstractEntityManagerImpl.java:1785)
         at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1705)
         at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1677)
         at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:458)
         at org.olat.basesecurity.BaseSecurityManager.loadForUpdate(BaseSecurityManager.java:1955)
         at org.olat.basesecurity.BaseSecurityManager.setIdentityLastLogin(BaseSecurityManager.java:1912)
         at org.olat.admin.user.delete.service.UserDeletionManager.setIdentityAsActiv(UserDeletionManager.java:385)
         at org.olat.login.auth.AuthenticationController.authenticated(AuthenticationController.java:59)
         at org.olat.login.OLATAuthenticationController.event(OLATAuthenticationController.java:227)
         at org.olat.core.gui.control.DefaultController$1.run(DefaultController.java:246)
         at org.olat.core.logging.activity.ThreadLocalUserActivityLoggerInstaller.runWithUserActivityLogger(ThreadLocalUserActivityLoggerInstaller.java:108)
      >>> stack of 3.cause::org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [org.olat.basesecurity.IdentityImpl#279347237]
      -> at org.hibernate.loader.Loader.checkVersion(Loader.java:1459)
         at org.hibernate.loader.Loader.instanceAlreadyLoaded(Loader.java:1563)
         at org.hibernate.loader.Loader.getRow(Loader.java:1504)
         at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:726)
         at org.hibernate.loader.Loader.processResultSet(Loader.java:953)
         at org.hibernate.loader.Loader.doQuery(Loader.java:921)
         at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:355)
         at org.hibernate.loader.Loader.doList(Loader.java:2554)
         at org.hibernate.loader.Loader.doList(Loader.java:2540)
         at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2370)
         at org.hibernate.loader.Loader.list(Loader.java:2365)
      

        Attachments

          Activity

            People

            Assignee:
            srosse Stéphane Rossé
            Reporter:
            srosse Stéphane Rossé
            Tester:
            Kirsten Scherer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h