481
Views
4
Comments
ORA-00001: unique constraint (OSADMIN.PK_OSSYS_USER_PERMISSION) violated
Question

While trying to delete certain Role access for a user in Role Management, it gives "ORA-00001: unique constraint (OSADMIN.PK_OSSYS_USER_PERMISSION) violated" where in OSSYS_USER_PERMISSION is a Outsystems generated table. Same code working in one environment but failing in another post deployment.

2016-04-22 00-29-45
Nuno Reis
 
MVP

It works in one environment and fails in another because the data is different.

Look into User_Permission and see the external keys. If one of them is UserRoleId and you are trying to delete the id that table needs (and it has delete rule=protect), it will give that precise error.


2023-08-09 02-51-33
Vikas Bansal

Nuno Reis wrote:

It works in one environment and fails in another because the data is different.

Look into User_Permission and see the external keys. If one of them is UserRoleId and you are trying to delete the id that table needs (and it has delete rule=protect), it will give that precise error.

Is it safe to remove the property delete rule = protect from User_Permission table as its a outsystems table? What could be the possible reason of it working in other environment but not in one environment while this delete rule = protect  may be applicable across all environments.



2016-04-22 00-29-45
Nuno Reis
 
MVP

Sorry, I was sleeping when I wrote that! Didn't notice the "Outsystems table" part and now it wasn't making sense.

Forget what I said. "unique constraint violated" means you tried to write twice a value into a unique field.

Your delete is probably trying to write again the same data instead of deleting. Can you share a screenshot?

2023-08-09 02-51-33
Vikas Bansal

Thanks for the quick response.

The issue was due to data migration and got fixed by resetting the sequence of the table. :)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.