Issue
During a Liferay DXP startup, the following error message appears in the logs, related to OpenID Connect provider configuration:
ERROR [...][BatchingBatch:139] HHH000315: Exception executing batch [org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: update OAuthClientASLocalMetadata set mvccVersion=?, modifiedDate=? where oAuthClientASLocalMetadataId=? and mvccVersion=?], SQL: update OAuthClientASLocalMetadata set mvccVersion=?, modifiedDate=? where oAuthClientASLocalMetadataId=? and mvccVersion=?
This error does not seem to affect the functionality of the OpenID Connect SSO.
Environment
- Quarterly Releases
Resolution
The error is caused by a deprecated class, OpenIdConnectProviderPortalInstanceLifecycleListener, which attempts to run an update on startup. This issue is specifically triggered by having an OpenID Connect (OIDC) provider configuration set at the SYSTEM scope (under Control Panel > System Settings).
While the error is generally harmless and can be ignored, the recommended solution is to move the configuration from the SYSTEM scope to the INSTANCE scope. Using SYSTEM scope for OIDC is a deprecated practice and is no longer supported in recent Liferay versions.