Skip to main content

This article explains what to do if there are too many inactive sessions on the OnWeb Server.

Problem:

We have a total of 7 users, and during the day all users are in full load, creating more than 1000 sessions (active or non-active, showing up on the OnWeb Administrator ‘Current Sessions’) on the OnWeb 7.2.5 server. Since the customer license limits the number of sessions to 1000, all sessions over 1000 are rejected and the server stops processing requests. What should we do?

Resolution:

The cause of the problem is that the application was coded using the following example where each time the client needs to request data from the host, the client application invokes a looping routine that calls a web service object. Every time the web service is called within the loop, a new session is created on the OnWeb Server. So at the point where 1000 requests are served, this would create 1000 sessions on the OnWeb server, all with different and unique session IDs. See partial code below:


.
.
.
for (int x = 0; x < 1000; x )
{
processrequest();
.
.
.
}
private voidprocessrequest()
{
try
{
WebServiceTest2.test.Object_MyHost onwebWebService = new WebServiceTest2.test.Object_MyHost();
// process request here with onwebWebService
}
catch (Exception ex) {…}
}

The resolution is to create a single session for a single user and then go through the desired iterations reusing the same web service object. The code below creates only one session and reuses the same session on OnWeb.


.
.
.
WebServiceTest2. test .Object_MyHost onwebWebService = new WebServiceTest2. test .Object_MyHost();
.
.
.
for (int x = 0; x < 1000; x )
{
processrequest();
.
.
.
}
private void processrequest()
{
lock (this)
{
try
{
// process request here with onwebWebService
}
catch (Exception ex) {…}
}
}

Incident Number: 2264909

Old KB# 14618

#Rumba
#OnWeb
#SupportTips/KnowledgeDocs