ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  ADO.NET Connection Pooling Explained
Subject:   Slightly bad advice
Date:   2004-04-15 22:58:50
From:   AndrewG
Response to: Slightly bad advice

A bit more information
You're right in saying ASP.NET is multi-threaded, but each request comes in on it's own thread and is seviced by a unique application instance. This means you don't have to concern yourself with MT issues - simply because all variables are local to your application instance. ASP.NET application objects are pooled and removed/returned to the pool upon each request/reply.
Shared/static variables will require protection from concurrent access. This is due to shared/static variables being maintained at the AppDomain level and not the Application level.
In the example of connection pooling a simple non-shared/static variable in the application object (initialized with the pool count) would be sufficient