cancel
Showing results for 
Search instead for 
Did you mean: 

Is GetIsConnected() a good indicator of whether the session id is valid?

Brian_Kalbfus
Confirmed Champ
Confirmed Champ

I have Unity API code that attempts to maintain an active connection to Onbase via the Java Unity API.  It has code like:

	public OnbaseProxy getProxy() {		if (main == null || !main.getApp().getIsConnected()) {			try {				main = new OnbaseProxy();			} catch (Exception e) {				LOGGER.error("Cannot connect to Onbase", e);			}		}		return main;	}

 

This is depending on the getIsConnected() method of the App object telling me whether it is connected to Onbase with a valid Session.  Even with this check in place, I am occasionally getting the following error when trying to find a Document Type via the API:

    Hyland.Unity.SessionNotFoundException    An error occurred within the Unity API: Failed to get session for session id: 5911e7bf-5f9c-4b45-ae44-076ef058d36b. Client host address: 10.1.62.212 (10.1.62.212)    Hyland.Unity.Application#Validate(Application.java:868)    Hyland.Unity.Application#ExecuteWithValidation(Application.java:846)    Hyland.Unity.ServiceDocumentTypeList#GetDocumentTypesByIDsAndNames(DocumentTypeList.java:466)    Hyland.Unity.ServiceDocumentTypeList#GetDocumentTypesString(DocumentTypeList.java:251)    Hyland.Unity.ServiceDocumentTypeList#Find(DocumentTypeList.java:105)    Hyland.Unity.ServiceDocumentTypeList#Find(DocumentTypeList.java:24)

 

Since I cannot call Hyland.Unity.Application#Validate() directly, is there any other way to verify a valid session?  Or, is my best bet to do something like:

try {main.getApp().getCore().getDocumentTypes();} catch (Exception e) {main = new OnbaseProxy();}

 

or, is this simply a bug in Hyland.Unity.Application#getIsConnected ?

 

Thanks!

Brian

1 ACCEPTED ANSWER

Adam_Kuhn
Star Collaborator
Star Collaborator

Hi Brian --

This issue would be better addressed via a Support Issue -- please contact us at apisupport@hyland.com

View answer in original post

2 REPLIES 2

Adam_Kuhn
Star Collaborator
Star Collaborator

Hi Brian --

This issue would be better addressed via a Support Issue -- please contact us at apisupport@hyland.com

Thanks for pointing me in the right direction!  They replied very fast and said the standard practice has been to use the Ping() method to test for a working connection to the AppServer.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.