RE: Database issue while updating user in Liferay DXP 7.1

Sanketh Iyer, modified 6 Years ago. Junior Member Posts: 25 Join Date: 2/2/12 Recent Posts
Hello,We have been facing a strange but severe issue recently.
Occasionally, while updating the user from control panel, it is throwing an error.
After analyzing the logs, we found that it is happening because of ORMException which says that row was updated in another transaction and also confirmed that there was no other user/admin who had performed update of same user at that time. Please find the attached log for more details.
To explain our architecture:
We have two instances of Liferay 7.1 running on the same machine. One acts as intranet and other one acts as extranet portals (access/behaviour handled through apache webserver).
Both instances share the same database.
There is no clustering mechanism in place.
We had the same architecture for our Liferay 6.2 environment and we had never faced or seen this issue.
Has anyone faced this issue before? It would be great if someone could help.2019-09-10 16:22:14.820 ERROR [ajp-nio-8212-exec-8][UserLocalServiceImpl:6262] com.liferay.portal.kernel.security.auth.AuthException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: {"agreedToTermsOfUse":false,"comments":"","companyId":"10153","contactId":"1111548","createDate":1561701292750,"defaultUser":false,"emailAddress":"","emailAddressVerified":false,"externalReferenceCode":"","facebookId":"0","failedLoginAttempts":1,"firstName":"Albert","googleUserId":"","graceLoginCount":0,"greeting":"Welcome Albert Quan!","jobTitle":"","languageId":"fr_FR","lastFailedLoginDate":1568125334707,"lastLoginDate":1567440038046,"lastLoginIP":"198.143.43.4","lastName":"Quan","ldapServerId":"-1","lockout":false,"lockoutDate":null,"loginDate":1568125226452,"loginIP":"","middleName":"","modifiedDate":1568125334707,"mvccVersion":"88","openId":"","portraitId":"0","reminderQueryAnswer":"","reminderQueryQuestion":"","screenName":"aquan75","status":0,"timeZoneId":"Europe\/Paris","userId":"1111547","uuid":"XXXX"} is stale in comparison to {"agreedToTermsOfUse":false,"comments":"","companyId":"10153","contactId":"1111548","createDate":1561701292750,"defaultUser":false,"emailAddress":"","emailAddressVerified":false,"externalReferenceCode":"","facebookId":"0","failedLoginAttempts":0,"firstName":"Albert","googleUserId":"","graceLoginCount":0,"greeting":"Welcome Albert Quan!","jobTitle":"","languageId":"fr_FR","lastFailedLoginDate":1568125220576,"lastLoginDate":1567440038046,"lastLoginIP":"198.143.43.4","lastName":"Quan","ldapServerId":"-1","lockout":false,"lockoutDate":null,"loginDate":1568125226452,"loginIP":"","middleName":"","modifiedDate":1568118104387,"mvccVersion":"89","openId":"","portraitId":"0","reminderQueryAnswer":"","reminderQueryQuestion":"","screenName":"aquan75","status":0,"timeZoneId":"Europe\/Paris","userId":"1111547","uuid":"XXXX"}

Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.liferay.portal.model.impl.UserImpl#1111547]
thumbnail
Amos Fong, modified 6 Years ago. Liferay Legend Posts: 2047 Join Date: 10/7/08 Recent Posts
There is no clustering mechanism in place.


I think this is your problem. The update doesn't have to happen at the same time. It can tell that its own User record doesn't match the DB's.

You need to setup clustering. If you don't, you'll start finding other issues later:

https://portal.liferay.dev/docs/7-1/deploy/-/knowledge_base/d/enabling-cluster-link