hi everyone,
I’m trying to use an async function to reduce the response time, but when I try to execute, i get the following error: “failed to lazily initialize a collection of role: sailpoint.object.Identity.assignedRoles, could not initialize proxy - no Session”
my code is doing something like:
List<Bundle> bundles = identity.getBundles(app);
List<Bundle> assignedRoles = identity.getAssignedRoles();
List<Bundle> bundlesComClassificaoExistente = new ArrayList<Bundle>();
CompletableFuture<Void> backgroundTask = CompletableFuture.runAsync(() -> {
try {
Boolean possuiClassificacao = false;
for(Bundle b : bundles) {
List<ObjectClassification> classificationsBundle = b.getClassifications();
for(ObjectClassification classification : classificationsBundle) {
if(classification.getClassification().getName().equals(classif)) {
possuiClassificacao = true;
bundlesComClassificaoExistente.add(b);
}
}
}
for(Bundle b : assignedRoles) {
List<ObjectClassification> classificationsBundle = b.getClassifications();
for(ObjectClassification classification : classificationsBundle) {
if(classification.getClassification().getName().equals(classif)) {
possuiClassificacao = true;
bundlesComClassificaoExistente.add(b);
}
}
}
} catch (InterruptedException e) {
e.printStackTrace();
}
});
what can be wrong with assignedRoles variable? the bundles variable is running ok