COM Server unloads after 8 minutes of idle time |
Issue: While running a Web Connection Automation server my servers are release after approximately 8 minutes of idle time. Is this normal?
This is an issue with IIS and COM objects. Any out of process COM object loaded from an ISAPI thread that is idle for more than 8 minutes will automatically release. Web Connection handles this occurrance and reloads the server when a new request comes in. This is actually quite handy for resource management as you can set up more servers than you need and only those needed are loaded at any given time.
However there some unfortunate side effects of the servers being unloaded by IIS. IIS unloads the objects without properly calling the COM server release mechanisms, and sometimes when reloading the server the first hit will result in an error. Subsequent hits however will run properly.
To work around this problem use the KeepAlive setting in wc.ini in the [Automation Servers] section.[Automation Servers] KeepAlive=1 ' force extra reference Server1=wcComDemo.wcDemoServer Server2=wcComDemo.wcDemoServerWith this setting in place the servers will not unload automatically by forcing an extra reference to keep the server alive. The side effect of this setting is that COM servers may not shut down properly using COM reference counting - because the extra reference is not marshalled the refcount going to 0 may not kill the server. To work around this Web Connection explicitly terminates the server file with TerminateProcess, if and only if the process was not killed through COM reference release.
Last Updated: 10/03/98