cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to get session for session id Error

Venkatroyal_Ayy
Champ in-the-making
Champ in-the-making

Hi,

     While accessing any documents through Unity API, i am getting the below exception continously.     

      Hyland.Unity.UnityAPIException: An error occurred within the Unity API: Failed to get session for session id: 4d317648-1d28-4189-b88c-939077624ade.

     Please help me out in fixing this issue.

Thanks

Venkat

7 REPLIES 7

Atit_Patel
Champ in-the-making
Champ in-the-making

How should I check if the given session id is still valid? After reading various posts, it seems like Application.IsConnected() method does not really check if the session is still valid and it only checks if the session can be disconnected.

-Atit

Grant_Fish
Confirmed Champ
Confirmed Champ
Are you keeping the session ID and reconnecting by session ID? This does work and we did it for a long time, but it wastes a lot of resources. If you just keep the Application object held in memory and disconnect it only when the user is done with your application you will get a lot better performance, especially if you have a large number of document types and/or keywords. Document types, keywords, and other information are cached in the Application object, and if you keep throwing it away and recreating it this cache has to be rebuilt every time.Even if you do hold the application object in memory, you may still experience a lost connection occasionally, such as the case already mentioned of an app pool recycle.We have the process of acquiring a connection (Application object) isolated in a separate method. Within this method, we get a new Application if we don't have one in memory already. Even if we do have one in memory, we give it a quick check by asking for the Document object by ID of a fixed document ID. In our case, we just use document ID 1. Even if the document ID that you ask for doesn't exist, it won't throw an error. You are just checking to see if the app server is still willing to talk to your Application object. If this fails, you can detect it and establish a new connection (and cache it in memory for the next call) before passing the Application object out to the calling method.

Grant_Fish
Confirmed Champ
Confirmed Champ
Another possible reason for unrecognized session IDs is multiple app servers behind a load balancer. Each app server has its own list of session IDs that are not shared with other app servers. If your load balancer switches you to a different app server the session ID won't be recognized. I believe that Hyland has extensive documentation on the correct way to do load balancing and solve this problem.