Upgrade failure caused by duplicate email addresses

Upgrade failure caused by duplicate email addresses

Error traces:

Exception occured while executing...
Sep 4, 2023 3:08:31 PM  [SYSERR]  [INFO] : java.sql.BatchUpdateException: Violation of PRIMARY KEY constraint 'RequestNotification_Recipients_PK'. Cannot insert duplicate key in object 'dbo.RequestNotification_Recipients'. The duplicate key value is (1925337, ).
Sep 4, 2023 3:08:31 PM  [SYSERR]  [INFO] : at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeBatch(SQLServerPreparedStatement.java:2065)
Sep 4, 2023 3:08:31 PM  [SYSERR]  [INFO] : at com.zoho.cp.WrappedPreparedStatement.executeBatch(WrappedPreparedStatement.java:185)
Sep 4, 2023 3:08:31 PM  [SYSERR]  [INFO] : at com.adventnet.db.api.RelationalAPI.executeBatch(RelationalAPI.java:965)
Sep 4, 2023 3:08:31 PM  [SYSERR]  [INFO] : at com.adventnet.persistence.DataAccess.executeBatch(DataAccess.java:3203)
Sep 4, 2023 3:08:31 PM  [SYSERR]  [INFO] : at com.adventnet.persistence.DataAccess.executeBatch(DataAccess.java:3187)
Sep 4, 2023 3:08:31 PM  [SYSERR]  [INFO] : at com.adventnet.persistence.DataAccess.insertRows(DataAccess.java:3106)
Sep 4, 2023 3:08:31 PM  [SYSERR]  [INFO] : at com.adventnet.persistence.DataAccess.add(DataAccess.java:349)
Sep 4, 2023 3:08:31 PM  [SYSERR]  [INFO] : at com.adventnet.persistence.DataAccess.add(DataAccess.java:292)

Cause: 

There are duplicate email addresses for the same draft with different cases (e.g., abc@mail.comABC@mail.com).

Note: 
We recommend taking a full backup before and after applying the below workaround.

Workaround:

>> Connect the server to DB, execute the below query, and export it as a file for reference.

select * from drafts;

>> Execute the below query to unify the email addresses.

 update drafts set toaddress=lower(toaddress),cc=lower(cc);

 and repeat step 1.

>>  The PPM files can be applied after the successful execution of the above queries .

                  New to ADSelfService Plus?