How to using connection pool technlogy in ASP

E

Egbert Nierop \(MVP for IIS\)

Utada P.W. SIU said:

The magical thing isn't it? If you can pool, your app will rock :)
ASP itself, does not use pooling. Only COM+ components written using C++ or
a .NET language ca be pooled. Note that pooling should not be a -target- but
a solution, if you really need it for specifici reasons. eg:
1) you need to cache specific data.
2) you have a specific driver that does -not- support database resource
pooling (ado does support!).
3) etc

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncomser/html/scalobjpool.asp
 
B

Bob Barrows [MVP]

Utada said:

You should be asking how NOT to use connection pooling. In ASP, connection
pooling is used automatically, without the developer having to do a thing.

Now, mind you, there are things a developer can do to disable connection
pooling, such as:

- failure to use an explicit connection object to open recordsets or execute
commands. This syntax:

set cn=createobject("adodb.connection")
cn.open <some connection string>
set rs=createobject("adodb.recordset")
rs.Source=<some query string>
rs.ActiveConnection = cn
rs.Open

will cause a second connection, using the connection string from cn, to be
opened and used to open rs. To prevent that, you must use the Set keyword:

Set rs.ActiveConnection = cn
See http://support.microsoft.com/?kbid=271128

- use of the OLE DB Services attribute in your connection string to disable
pooling

- failure to close and destroy connections when you are finished with them

Here is some more information:
http://msdn.microsoft.com/library/en-us/dnmdac/html/pooling2.asp
http://support.microsoft.com/?scid=kb;en-us;Q176056
http://support.microsoft.com/default.aspx?scid=kb;en-us;191572
http://support.microsoft.com/default.aspx?scid=kb;en-us;324686

Bob Barrows
 
D

Dave Anderson

Bob said:
rs.ActiveConnection = cn

...will cause a second connection, using the connection
string from cn, to be opened and used to open rs. To
prevent that, you must use the Set keyword:

Set rs.ActiveConnection = cn

Or use JScript, as the above is the only possible syntax for assigning the
ActiveConnection property in JScript.



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top