Hi,
I have built ASP.NET app. I need to utilize a third party COM object SDK for managing documents. The application's name is "Interwoven". According to the COM object documentation you should "Never create more than one IManDMS object per application".
So, I decided to create one instance of the IManDMS object and store it in an Application variable. Here is the function that I use to retrieve a IManDMS object:
public static IManDMS GetDMS()
{
IManDMS dms = HttpContext.Current.Application["DMS"] as IManage.IManDMS;
if (dms == null)
{
dms = new IManage.ManDMSClass();
HttpContext.Current.Application["DMS"] = dms;
}
return dms;
}
…
// Here is a code snippet showing its use
IManage.IManDMS dms = GetDMS();
string serverName = "myServer";
IManSession s = dms.Sessions.Add(serverName);
s.TrustedLogin();
// Do something with the session object, like retrieve documents.
s.Logout();
dms.Sessions.RemoveByObject(s);
…
The above code works fine when only one person is requesting the .ASPX page at a time. When 2 users concurrently request the page I get the following error:
[Sessions ][Add ]Item "SV-TRC-IWDEV" already exists in the collection
Apparently you cannot add more than one session to the IManDMS object, with the same name, at the same time. This means I can only have one session open, for the entire app, at any given time.
Is there anyone who has experience with a similar issue and can offer a suggestion on how to get around this problem, assuming I can't create more than one IManDMS object per app?
Thanks.