user78u
(user78u)
October 4, 2017, 12:21pm
#1
Hello Cuba Team,
I am getting Unique constraint violation while updating roles.
like 1st while creating role I am selecting “deny” for screen and creating.
2nd: I am deselecting both “allow” and “deny” for that particular screen and updating.
3rd: Selecting “deny”, then it is throwing exception.
How to resolve this issue in cuba application.
Thanks!!
shiryaeva
(Olga Shiryaeva)
October 5, 2017, 6:14am
#2
Hi,
We cannot reproduce this problem. Could you please attach a sample application where this exception is thrown?
user78u
(user78u)
October 5, 2017, 7:10am
#3
Please find the attached log file and screen shot
app.log (192.8K)
shiryaeva
(Olga Shiryaeva)
October 5, 2017, 7:14am
#4
Thank for the screenshot, but it is not very useful for debugging. A small test project would help.
user78u
(user78u)
October 5, 2017, 7:22am
#5
But I am able to get this exception only in my application
shiryaeva
(Olga Shiryaeva)
October 6, 2017, 6:40am
#6
We have checked your case on MySQL database and haven’t reproduced the problem.
As far as I can see from the logs, the problem is caused by the Role with id c4aeb0032a01375832049c14b5e23a5c :
org.eclipse.persistence.exceptions.DatabaseException:
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'c4aeb0032a01375832049c14b5e23a5c-10-help-1000-01-01 00:00:00.000' for key 'IDX_SEC_PERMISSION_UNIQUE'
Error Code: 1062
Call: INSERT INTO SEC_PERMISSION (ID, CREATE_TS, CREATED_BY, DELETE_TS, DELETED_BY, TARGET, PERMISSION_TYPE, UPDATE_TS, UPDATED_BY, VALUE, VERSION, ROLE_ID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
bind => [4cda7349016c76ef559dfface9c18f76, 2017-10-05 12:37:34.142, admin, null, null, help, 10, 2017-10-05 12:37:34.142, null, 0, 1, c4aeb0032a01375832049c14b5e23a5c]
Query: InsertObjectQuery(com.haulmont.cuba.security.entity.Permission-4cda7349-016c-76ef-559d-fface9c18f76 [detached])
Try to delete and re-create this role manually.