Prevent concurrent modifications of the same User object

Jan Tošovský, muokattu 2 Vuodet sitten. Liferay Master Viestejä: 576 Liittymispäivä: 22.7.2010 Viimeisimmät viestit

When the User is signed in, the last login date is updated in DB. However, in some scenarios, this can happen in multiple threads, and fail:

2024-06-18 08:12:16.932 ERROR [ajp-nio-127.0.0.1-8009-exec-2085][MainServlet:543] null
com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: javax.persistence.OptimisticLockException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.liferay.portal.model.impl.UserImpl#964101]
  1. Enable the Remember Me option when logging into the portal
  2. Open portal pages in multiple tabs
  3. Close the browser
  4. Open the browser. The tabs with portal pages are reloaded and each performs auto-logging on behalf of the user (in fast pace). These requests are processed in multiple threads and sometimes fail.

 

thumbnail
Jamie Sammons, muokattu 2 Vuodet sitten. Expert Viestejä: 367 Liittymispäivä: 5.9.2014 Viimeisimmät viestit

Bug report created: https://liferay.atlassian.net/browse/LPD-30166