cancel
Showing results for 
Search instead for 
Did you mean: 

Unity API v14 not throwing SessionNotFound Exception when expected

Jose_Galdamez
Confirmed Champ
Confirmed Champ

After changing my Unity API library to version 14.0.2.127, I'm getting a different exception when a session is lost, instead of the expected SessionNotFound Exception.

To reproduce the issue with the code below, just reset the application pool shortly after connecting and perform an action. Please advise.


public void TestAppReset()
{
OnBaseAuthenticationProperties onbaseAuthenticationProperties = Hyland.Unity.Application.CreateOnBaseAuthenticationProperties(_OnbaseURL, _OnbaseUsername, _OnbasePassword, _OnbaseDataSourceName);

using (Application onbaseApplication = Application.Connect(onbaseAuthenticationProperties))
{

try

{

//perform appPool recycle before executing this instruction to reproduce the error
onbaseApplication.Core.GetDocumentByID(1);
}
catch (SessionNotFoundException ex) //Exception is not thrown
{
Console.WriteLine("Exception thrown as expected");
return;
}

}

}

Error Msg:

at Hyland.Types.HSISerializerV2.DeserializeResponseList(Stream stream)
at Hyland.Types.OptimizedSoapServiceClient.executeVersion2(HttpWebRequest request, RequestList requestList, SerializationContext context)
at Hyland.Types.OptimizedSoapServiceClient.ExecuteCore(RequestList requestList, Action`1 action)
at Hyland.Types.SoapServiceClient.Hyland.Types.IServiceClientInternal.Execute(RequestList requestList, Action`1 action)
at Hyland.Types.SoapServiceClient.Execute(IRequestList requestList)
at Hyland.Unity.Application.Execute(Request request, Int32 numberOfAttempts)
at Hyland.Unity.Application.Execute(Request request)
at Hyland.Unity.Application.ExecuteWithValidation(Request request)
at Hyland.Unity.ServiceAccess.GetDocumentByID(Application app, Int64 id, DocumentRetrievalOptions options)
at Hyland.Unity.Core.GetDocumentByID(Int64 id, DocumentRetrievalOptions options)
at Hyland.Unity.Core.GetDocumentByID(Int64 id)

1 ACCEPTED ANSWER

Adam_Ryman
Star Contributor
Star Contributor

Hello Jose,

This is a known issue that surfaced in OnBase 14 due some security changes that were made in the application server.  This issue usually occurs in the case where a connection is lost.  For instance, if a client application is connected to the application server and the application server is reset, the next call the client application makes will fail since the session no longer exists and will return the ‘EndOfStreamException’ exception.

The error that should be returned is a ‘SessionNotFoundException’ exception but as mentioned, this is no longer the case.  However, this issue was corrected in v OnBase 15.0.0.7 to once again return the correct exception. 

This was also backported to 14.0.2.172 with SCR#230077 , so upgrading to this build should solve your issue.

Thanks,

Adam Ryman

Hyland API Analyst

View answer in original post

1 REPLY 1

Adam_Ryman
Star Contributor
Star Contributor

Hello Jose,

This is a known issue that surfaced in OnBase 14 due some security changes that were made in the application server.  This issue usually occurs in the case where a connection is lost.  For instance, if a client application is connected to the application server and the application server is reset, the next call the client application makes will fail since the session no longer exists and will return the ‘EndOfStreamException’ exception.

The error that should be returned is a ‘SessionNotFoundException’ exception but as mentioned, this is no longer the case.  However, this issue was corrected in v OnBase 15.0.0.7 to once again return the correct exception. 

This was also backported to 14.0.2.172 with SCR#230077 , so upgrading to this build should solve your issue.

Thanks,

Adam Ryman

Hyland API Analyst