Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Speed of Development

Reply
Thread Tools

Speed of Development

 
 
George Ter-Saakov
Guest
Posts: n/a
 
      04-22-2004
Yes. Do the test. I tested with MS SQL.
Create an ASP page (not asp.net)

<%
Dim con
Set con = CreateObject("ADODB.Connection")
con.Open "Provider=SQLOLEDB.1;Password=test;Persist Security Info=True;User
ID=test;Initial Catalog=test;Data Source=test"
%>

Hit it couple times then go to Enterprise Managment Managment/Current
Activity/Process Info and you will see only one connection.
So it's not necessary to close connection in an APS page. ADO closes it for
you as soon as object goes out of scope.
MSDN is wirtten by people and usually not by developers who actually created
ADO.

BTW: It's practically impossible to write a clean ASP page which will close
connections in any case (exception, script timeout, ...)


George.


"Peter O'Reilly" <(E-Mail Removed)!N!O!.S!P!AM!> wrote in message
news:(E-Mail Removed)...
> > There was a bug though in earlier versions of ADO when due to the cyclic
> > reference between recordset and connection the connection will not be

> closed
> > even if it goes out of scope.

>
> It was never a bug. In theory what you write should be the case (and is

ok
> for a very light load), but practice tells me otherwise. Some RDBMS like
> Oracle 8,9i or MS Access (Jet) are much less forgiving than SQL Server

with
> respect to not closing connections and recordsets. I have found this to

be
> the case with IIS 4, 5, 5.1. Load testing a classic ASP application will
> make this immediately apparent.
>
> Microsoft/MSDN docs have consistently parroted all along that ADO

recordsets
> and connection objects should be explicitly closed. The same is true,

even
> more so for the .Net framework's datareader and connection objects. For
> instance, it is not possible to (re)use another datareader on the

connection
> without closing the first. The result is an exception raised/run time
> error.
>
> --
> Peter O'Reilly
>
>



 
Reply With Quote
 
 
 
 
Peter O'Reilly
Guest
Posts: n/a
 
      04-22-2004
> Hit it couple times then go to Enterprise Managment Managment/Current
> Activity/Process Info and you will see only one connection.
> So it's not necessary to close connection in an APS page. ADO closes it

for
> you as soon as object goes out of scope.


Perhaps it's because you had to 2 Management consoles open - one for each
connection connection. A couple of times, I see that's definitive and
conclusive.

Reread my message. What did I write about SQL Server? What did I write
about load?

> MSDN is wirtten by people and usually not by developers who actually

created
> ADO.


I sure hope their writing is done by people(and not trolls, like here).
Some may jibe that their marketing department writes them, but they are
written by their technical staff many of them (software engineers) who have
coded their various products including ADO.

--
Peter O'Reilly


 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      04-22-2004
Ah, yes. That's exactly right, George.

--
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"George Ter-Saakov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I am talking about ASP. Not ASP.NET.
> In ASP.NET connection must be closed.
> In ASP it's not necessary.
>
> George.
>
>
> "Kevin Spencer" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > > And there is not need to close connections or destroy objects.

> >
> > Hang on a second, George. Connections DO need to be closed, or disposed.
> > Setting objects to Nothing does Nothing. Closing Connections frees them

up
> > for re-use.
> >
> > --
> > HTH,
> > Kevin Spencer
> > .Net Developer
> > Microsoft MVP
> > Big things are made up
> > of lots of little things.
> >
> > "George Ter-Saakov" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > I was talking about ASP (not ASP.NET)
> > > In ASP objects are released when they go out of scope.
> > >
> > > And there is not need to close connections or destroy objects.
> > >
> > > There was a bug though in earlier versions of ADO when due to the

cyclic
> > > reference between recordset and connection the connection will not be

> > closed
> > > even if it goes out of scope.
> > >
> > > George.
> > >
> > >
> > > "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
> > > news:ukRS$(E-Mail Removed)...
> > > > > In ASP.
> > > > > Connection does not need to be closed,
> > > > > Object does not need to be destroyed.
> > > > >
> > > > not true really.... they will eventually go away, but in the

meantime
> > they
> > > > can, and will, eat major resources. It's always better to explicitly
> > > > close/kill them.
> > > >
> > > > > Also i bet that his ASP forms do not have any validations.
> > > > >
> > > > some of the ASP.NET ones are clientside though, and could be

> replicated
> > in
> > > > ASP.
> > > >
> > > >
> > > > --
> > > > Curt Christianson
> > > > Owner/Lead Developer, DF-Software
> > > > www.Darkfalz.com
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Andrea Williams
Guest
Posts: n/a
 
      04-26-2004
ASP Best practices for our company say to "close the connections". We have
seen problems when connection are not explicitly closed, and that IS with
SQL Server. If connections aren't closed, OLEDB starts to return an
unspecified error after a while (depending on load) and the only way to get
rid of it is to reboot or change the conncetion string to ODBC. We found
the problem when converting to OLEDB from ODBC a while ago. ODBC doesn't
seem to care, but OLEDB does.

Andrea

"George Ter-Saakov" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Yes. Do the test. I tested with MS SQL.
> Create an ASP page (not asp.net)
>
> <%
> Dim con
> Set con = CreateObject("ADODB.Connection")
> con.Open "Provider=SQLOLEDB.1;Password=test;Persist Security

Info=True;User
> ID=test;Initial Catalog=test;Data Source=test"
> %>
>
> Hit it couple times then go to Enterprise Managment Managment/Current
> Activity/Process Info and you will see only one connection.
> So it's not necessary to close connection in an APS page. ADO closes it

for
> you as soon as object goes out of scope.
> MSDN is wirtten by people and usually not by developers who actually

created
> ADO.
>
> BTW: It's practically impossible to write a clean ASP page which will

close
> connections in any case (exception, script timeout, ...)
>
>
> George.
>
>
> "Peter O'Reilly" <(E-Mail Removed)!N!O!.S!P!AM!> wrote in message
> news:(E-Mail Removed)...
> > > There was a bug though in earlier versions of ADO when due to the

cyclic
> > > reference between recordset and connection the connection will not be

> > closed
> > > even if it goes out of scope.

> >
> > It was never a bug. In theory what you write should be the case (and is

> ok
> > for a very light load), but practice tells me otherwise. Some RDBMS

like
> > Oracle 8,9i or MS Access (Jet) are much less forgiving than SQL Server

> with
> > respect to not closing connections and recordsets. I have found this to

> be
> > the case with IIS 4, 5, 5.1. Load testing a classic ASP application

will
> > make this immediately apparent.
> >
> > Microsoft/MSDN docs have consistently parroted all along that ADO

> recordsets
> > and connection objects should be explicitly closed. The same is true,

> even
> > more so for the .Net framework's datareader and connection objects. For
> > instance, it is not possible to (re)use another datareader on the

> connection
> > without closing the first. The result is an exception raised/run time
> > error.
> >
> > --
> > Peter O'Reilly
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Web Application development vs windows client development cabernet123@hotmail.com ASP .Net 0 11-17-2005 12:09 AM
enterprise application development versus traditional software development jrefactors@hotmail.com Java 2 01-15-2005 10:45 PM
development environment architecture for ASP.NET development team Akhlaq Khan ASP .Net 4 09-27-2004 01:33 PM
speed speed speed a.metselaar Computer Support 14 12-30-2003 03:34 AM
Re: Development best practices and knowing when to exercise control over development Kevin Spencer ASP .Net 2 08-06-2003 09:33 PM



Advertisments