Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Database issue while updating user in Liferay DXP 7.1
			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]
		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]
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