Unhandled SQLServerException with unique attribute

Hello,

With SQL Server set as data store we get an unhandled SQLServerException in the Onboarding tutorial project when saving a new Department instance with a duplicate name.

image

If an entity is created with the soft delete trait then the unique index constraint works and the exception is handled with an error notification that can be localized.

image

Best regards,
Peter

Hi Peter,

Thank you for spotting the problem. We’ll try to fix it in the next update:

Meanwhile, you can set this property in your project to make the framework recognize the unique constraint violation exception from SQLServer:

jmix.data.unique-constraint-violation-pattern = Violation of UNIQUE KEY constraint '(.+?)'

Regards,
Konstantin