Hi Priyadharshini k,
The root cause is that the TcSession variable is either empty or not saving properly when used in microflows like UpdateSession or in save search queries. This usually happens when the session doesn’t exist in the database, hasn’t been committed yet, or has expired.
To fix this, make sure the session retrieval logic (like in RetrieveTcSessionBasedOnConfigName) checks if a valid session exists. If it doesn't, a new session is create using LoginToTeamcenter, then committed before moving forward.
It also helps to add logs to verify if the session is actually being retrieved. The key fix was always committing the TeamcenterSession before using it in any operation that depends on database relationships. This resolved the integrity constraint error and made the integration work smoothly.
Thanks
Reemali