Hi All,
I am developing custom rule, where I am filtering application accounts using QueryOptions.
I am getting Identity from Link. I am able to get only first Identity.
When Its reached to get the second identity I am getting LazyInitializationException.
The same code is working fine when I use hardcoded value in IdentityName in Filter.
org.hibernate.LazyInitializationException: could not initialize proxy [sailpoint.object.Identity#(Identity id will show here)] - no Session
Below is the code:
Filter filter=Filter.join("identity","Identity.id");
filter=Filter.and(filter,Filter.join("application","Application.id"));
filter=Filter.and(filter,Filter.eq("application.name","ADApplicationName"));
filter=Filter.and(filter,Filter.eq("identity.identityState","active"));
QueryOptions qo=new QueryOptions();
qo.addFilter(filter);
List acctList=context.getObjects(Link.class,qo);
for(Link link : acctList)
{
Identity id_obj=link.getIdentity();
}
when I give identityName as hardcoded value as below in filter its not throwing any exception. Rule is running fine.
Filter filter=Filter.join("identity","Identity.id");
filter=Filter.and(filter,Filter.join("application","Application.id"));
filter=Filter.and(filter,Filter.eq("application.name","ADApplicationName"));
filter=Filter.and(filter,Filter.eq("identity.identityState","active"));
filter=Filter.and(filter,Filter.eq("identity.name",idName));
I tried context.decache(link) as well. But still getting lazyException. Pls provide me any lead to fix this issue.