Session not found exception for LinqLocalDataAdapter

What could be the reason I receive a ‘Session not found’ exception for a LinqLocalDataAdapter connection (which takes long?)

In the watch window after the crash it looks like this

readonly RemObjects.DataAbstract.Linq.LinqLocalDataAdapter dataAdapter_;

Creation code:

var sesmgr = RemObjects.SDK.Server.Engine.SessionManager;
if (sesmgr == null)
  return null;
Guid guid = Guid.NewGuid();
var ses = sesmgr.GetSession(guid);
if (bDisableSQLLog)
  ses["disableSQLLog"] = true;
var dataAdapter = new LinqLocalDataAdapter(servicename, guid);
sesmgr.ReleaseSession(ses);

The object lives long (several minutes)

Are there some timeouts?

What could cause the session to dissapear?

Can this be detected/debugged?

Hi,

default timeout for sessions is 10 min (600 sec).

session can be expired if it isn’t touched more than SessionManager.Timeout seconds.

You can use SessionManager.OnSessionExpired event for detecting such cases.

as a workaround, you can increase SessionTimeout. for example try to set it to 30 min.