Hi,
When we get UniqueConstraintViolationException the name of the constraint is empty so the localized error message can’t resolve.
You can test it with the Onboarding demo and MSSQL Server 2022 as datastore.
Try to save another user with name ‘admin’.
Error message in debug window:
Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert duplicate key row in object ‘dbo.USER_’ with unique index ‘IDX_USER__ON_USERNAME’. The duplicate key value is (admin).
Error message on the UI:
Unique constraint violation occurred
Localized error message in the message bundle that is expected on the UI:
databaseUniqueConstraintViolation.IDX_USER__ON_USERNAME=A user with the same username already exists
It would be nice if it could work with your default patterns and we don’t have to use another in the applicaton.configuration with the jmix.data.unique-constraint-violation-pattern setting because we plan to support multiple DBMS.
Thanks,
Peter