Re: ODBC/OLE DB Connection Pool

From: Bob Barrows [MVP] (reb01501_at_NOyahoo.SPAMcom)
Date: 11/29/04


Date: Mon, 29 Nov 2004 15:34:10 -0500

Stuart Carnie wrote:
>> The first two are not relevant in ASP. The last one is also not
>> relevant: ADO is not free-threaded, so it is not recommended that a
>> single global connection be kept open for the application as this
>> will serialize all communications with the database.
>
> This is incorrect - OLE DB objects are free threaded. It does not
> serialize database access - my test application demonstrates this as
> it is very multithreaded, and the connections are reused without any
> problems across threads ONCE they are returned to the pool.

That may be so, but according to msdn, ADO installs itself as
apartment-threaded, unless the registry setting is made to make it
both-threaded. This is well-documented at msdn.microsoft.com/library (look
up makfre15.bat). See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnasp/html/asptips.asp
(the tip against caching connection in Application and Session)

According to that article, using a connection cached in Application (which
is really the only way to accomplish the goal of having a single global
connection in ASP) causes all database access to be serialized.

Bob Barrows

-- 
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Relevant Pages

  • RE: passwords in asp pages
    ... about the specifics of the connection other than the type (ie. by type I ... about your asp, ... passwords for credentials to an sql database on another machine. ... to facilitate one-on-one interaction with one of our expert instructors. ...
    (Security-Basics)
  • Re: Problem with ASP on Webserver
    ... I just enabled more ASP debug information and the dump looks like this: ... calling service 0x00044110 with connection socket ... (Accept-Language:) ... Server: Microsoft-WinCE/5.0 ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Problem with ASP on Webserver
    ... m_bstrScriptData, // script text ... ASP: Parse error in script caught by IActiveScript ... (Accept-Language:) ... calling service 0x00044110 with connection socket ...
    (microsoft.public.windowsce.platbuilder)
  • Re: ODBC/OLE DB Connection Pool
    ... >> will serialize all communications with the database. ... (the tip against caching connection in Application and Session) ... connection in ASP) causes all database access to be serialized. ...
    (microsoft.public.data.ado)
  • Re: ODBC/OLE DB Connection Pool
    ... >> will serialize all communications with the database. ... (the tip against caching connection in Application and Session) ... connection in ASP) causes all database access to be serialized. ...
    (microsoft.public.data.oledb)

Loading