Duplicate key error post SonarQube 5.3 upgrade

北城以北 提交于 2020-01-07 05:00:29

问题


We have recently upgraded to Sonar 5.3 from 4.4.1 and seen duplicate key issue with one of our projects. I checked the collation and found database server and database to be case insensitive and column to be case sensitive. Should we change collation on the database to "Latin1_General_CS_AS" ? Changing the collation on the server is bit difficult but we can try with database.

SELECT SERVERPROPERTY('COLLATION')

Output: Latin1_General_CI_AS

SELECT DATABASEPROPERTYEX('<SonarDatabaseName>', 'Collation') SQLCollation;

Output: Latin1_General_CI_AS

For the column, it is "Laitn1_General_CS_AS"

Error in sonar log. I did see a duplicate key in the table but not sure if this is due to collation as reported here Duplicate key error with SonarQube 5.2:

            ERROR [o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVM28yZdM8YcgYQ_GJuI
            org.sonar.server.computation.component.VisitException: Visit failed for Component
            .
            .
            ### Error updating database.  Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert duplicate key row in object 'dbo.projects' with unique index 'projects_kee'.

Thanks in advance.


回答1:


Case sensitivity is a requirement, so yes you really need to change the collation of this database (putting it case-sensitive (CS) and accent-sensitive (AS)).



来源:https://stackoverflow.com/questions/35827598/duplicate-key-error-post-sonarqube-5-3-upgrade

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!