Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 17th, 2003, 05:36 AM
Authorized User
 
Join Date: Jul 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB/ASP.NET + Connection Pooling

Hi

If I use an standard ASP page


<%
 Response.Write "Creating Connection Object" & "<br />"
 Set CNN = Server.CreateObject("ADODB.Connection")
 Response.Write "Open Connection" & "<br />"
 CNN.Open "books.udd"
 Response.Write "Close Connection" & "<br />"
 CNN.Close
 Response.Write CNN.State & "<br />"
 Response.Write "Set CNN instance to nothing" & "<br />"
 Set CNN = Nothing
%>

I notice that even after I issue

Connection.Close
Set Connection = Nothing

the "active connection" persists for roughly 60 seconds (this seems to be some kind of IIS default as my client driver has no configurable setting for CP).

However, if I use a VB.NET ASP page that mirrors the same logic

<%@ Page Language="VB" Debug="True" CompilerOptions='/R:"C:\Program Files\Microsoft.NET\Odbc.Net\Microsoft.data.odbc.d ll"'%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace = "Microsoft.Data.Odbc" %>

<script language="vb" runat="server">
Sub Page_Load()
     Dim cn as OdbcConnection
     cn = New OdbcConnection ("dsn=books.udd;uid=;pwd=;")

 try
   Cn.Open()
   con_open.text="Connection Open successfully.<br />"
   Cn.Close()
   con_close.text="Connection Closed successfully.<br />"
  catch e as exception
   con_open.text="Connection failed to open.<br />"
   con_close.text = e.ToString()
 end try
end Sub
</script>


the connection is cleaned up straight off.

Why does this difference manifest itself?

Tony

 
Old February 24th, 2005, 05:15 PM
Registered User
 
Join Date: Feb 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by aleahy
 Hi

If I use an standard ASP page


<%
Response.Write "Creating Connection Object" & "<br />"
Set CNN = Server.CreateObject("ADODB.Connection")
Response.Write "Open Connection" & "<br />"
CNN.Open "books.udd"
Response.Write "Close Connection" & "<br />"
CNN.Close
Response.Write CNN.State & "<br />"
Response.Write "Set CNN instance to nothing" & "<br />"
Set CNN = Nothing
%>

I notice that even after I issue

Connection.Close
Set Connection = Nothing

the "active connection" persists for roughly 60 seconds (this seems to be some kind of IIS default as my client driver has no configurable setting for CP).

However, if I use a VB.NET ASP page that mirrors the same logic

<%@ Page Language="VB" Debug="True" CompilerOptions='/R:"C:\Program Files\Microsoft.NET\Odbc.Net\Microsoft.data.odbc.d ll"'%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace = "Microsoft.Data.Odbc" %>

<script language="vb" runat="server">
Sub Page_Load()
     Dim cn as OdbcConnection
     cn = New OdbcConnection ("dsn=books.udd;uid=;pwd=;")

try
Cn.Open()
con_open.text="Connection Open successfully.<br />"
Cn.Close()
con_close.text="Connection Closed successfully.<br />"
catch e as exception
con_open.text="Connection failed to open.<br />"
con_close.text = e.ToString()
end try
end Sub
</script>


the connection is cleaned up straight off.

Why does this difference manifest itself?

Tony


Does anyone know if i need to put more dan one opath in this line how can i do that
<%@ Page Language="VB" Debug="True" CompilerOptions='/R:"C:\Program Files\Microsoft.NET\Odbc.Net\Microsoft.data.odbc.d ll"'%>
i want to add
'c:\rog.dll'







Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection Pooling nigam.anand Apache Tomcat 0 October 18th, 2006 08:39 AM
Connection pooling and Timeout Raghavendra_Mudugal SQL Server 2000 2 May 24th, 2006 01:42 AM
connection pooling error aravwind ADO.NET 0 November 23rd, 2005 07:20 AM
Connection pooling in VB vijayma VB How-To 0 March 18th, 2005 03:51 AM
Connection Pooling with Beans angrycat Apache Tomcat 4 September 16th, 2004 06:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.