Getting could not initialize proxy - no Session

Problem

Getting below error - An unexpected error occurred: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: sailpoint.object.Identity.capabilities, could not initialize proxy - no Session with below options on the identity refresh task

  1. Refresh assigned, detected roles and promote additional entitlements
  2. Provision assignments

Hello Anil,
https://developer.sailpoint.com/discuss/t/lazy-initialize-issue/55528

Check this, it is similar to the issue you mentioned

Looks like somewhere in your workflows or rule methods you are directly using objects instead of ids or names which can cause this issue.

Resolution: Although I was unable to find the exact root cause, Tomcat restart resolved my issue.

Hi @canilkumar,

The main reason for this behavior is that the object’s state changes before you commit its state. To avoid this issue within a transaction or flow, do not modify the object’s state.

A simple solution is to refrain from passing the object to any method calls. Instead, always retrieve the object’s context and set the necessary data before saving.

Thanks
Siva Lankapalli