Help and Support
 

powered byLive Search

INFO: Do Not Store STA Objects in Session or Application

Article ID:243543
Last Review:September 17, 2003
Revision:3.1
This article was previously published under Q243543

SUMMARY

Do not store Single-Threaded Apartment (STA) COM components in an Active Server Pages (ASP) Session or Application.

Back to the top

MORE INFORMATION

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:
175167 (http://support.microsoft.com/kb/175167/EN-US/) HOWTO: Persist Values Without Session

Back to the top

REFERENCES

For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:
175167 (http://support.microsoft.com/kb/175167/EN-US/) HOWTO: Persist Values Without Session
243548 (http://support.microsoft.com/kb/243548/EN-US/) INFO: Design Guidelines for VB Components Under ASP

Back to the top


APPLIES TO
Microsoft Active Server Pages 4.0, when used with:
  Microsoft Internet Information Server 3.0
  Microsoft Internet Information Server 4.0

Back to the top

Keywords: 
kbaspobj kbinfo kbscalability kbthread KB243543

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.