I am trying to delete a role using below code and gets a constraint error. I know IT roles has profiles and the error is related to complaining about the child records. What is the best to do a cascade delete of a role.
The conflict occurred in database “identityiq”, table “identityiq.spt_profile”, column ‘bundle_id’.
@venus I am using the following rule to execute a mass role deletion to be speicifc there are about 80k roles that needs to be deleted. I am using a run rule task and It takes about a day for the task to run and deletes about 500 roles and then either terminates itself or gives out an error - Can you please help me with what you exactly did and it worked for you?
Here is the code being used -
String ROLE_SUFFIX = “Role Ark”; //Name of the role goes here
int rolecount = 0;
Filter filter = Filter.and(Filter.like(“name”, ROLE_SUFFIX, Filter.MatchMode.START));
QueryOptions qo = new QueryOptions();
qo.addFilter(filter);
IncrementalObjectIterator iOitr = new IncrementalObjectIterator(context, Bundle.class, qo);
while(iOitr.hasNext()){
rolecount = rolecount + 1;
Bundle role = iOitr.next();
Terminator term = new Terminator(context);
term.deleteObject(role);
}