This article was previously published under Q243543
This article has been archived. It is offered "as is" and will no longer be updated.
Do not store Single-Threaded Apartment (STA) COM components in an Active Server Pages (ASP) Session or Application.
Storing objects that are marked as STAs, such as components produced by Visual Basic (ActiveX DLLs), limit scalability and can negatively impact performance. Storing STAs in Session scope causes thread affinity and defeats the purpose of a thread pool. When an STA component is stored in Session scope, all subsequent ASP requests from the same user (session) must be executed by the thread that created the component.
In general, stateless page-scoped components perform best. Page-scoped components are COM objects that you create and destroy within the same ASP page. If you need to pass state information from page to page, the following article demonstrates possible techniques that do not use Session: