Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: connection closing in asp.net


Message #1 by "Hristo Hristov" <nohaber@h...> on Mon, 14 May 2001 15:33:58
Hello everyone,

after digging into a lot of sample asp.net, code and tutorial (include 

ibuyspy examples) I really cannot figure out when do I have to close 

ado/sql connection, and when the ADO+ does it automatically? What is your 

opinion on the best possible connection writing practices? I am gonna have 

to implement asp.net / oracle web application using OLE DB. Any 

suggestions on my questions would be appreciated. Hope they don't sound 

very stupid. Thanx for your time in advance.
Message #2 by John Pirkey <mailjohnny101@y...> on Mon, 14 May 2001 10:49:46 -0700 (PDT)

Until i hear differently, I'm going to continue to open a connection, get/update my

data and then close it.  AFAIK, ADO.Net doesn't do anything spectacular with

connection management in the area.  ADO.Net has those datasets which make it nice

for quick lookups, so once you fill your dataset, you can close your connection and

then just go through your data clientside.  Datasets can show multi-table

relationships and keep those enforced, so once you get your data into them, there's

almost no need to go back to the database.



good luck,



john



--- Hristo Hristov <nohaber@h...> wrote:

> Hello everyone,

> after digging into a lot of sample asp.net, code and tutorial (include 

> ibuyspy examples) I really cannot figure out when do I have to close 

> ado/sql connection, and when the ADO+ does it automatically? What is your 

> opinion on the best possible connection writing practices? I am gonna have 

> to implement asp.net / oracle web application using OLE DB. Any 

> suggestions on my questions would be appreciated. Hope they don't sound 

> very stupid. Thanx for your time in advance.

> ---

> SoftArtisans helps developers build robust, scalable Web applications!

> Excel Web reports, charts: http://www.softartisans.com/excelwriter.html

> File uploads: http://www.softartisans.com/saf.html

> Transactional file management: http://www.softartisans.com/saf1.html

> Scalability: http://www.softartisans.com/saxsession.html

> ASPstudio value pack: http://www.softartisans.com/aspstudiosuite.html




> 





=====



---------------------------- 

John Pirkey 

MCSD 

John@S... 

http://www.stlvbug.org



__________________________________________________

Do You Yahoo!?

Yahoo! Auctions - buy the things you want at great prices

http://auctions.yahoo.com/

Message #3 by "Hristo Hristov" <nohaber@h...> on Tue, 15 May 2001 08:32:19
Thanx for the reply John,

but I am still not sure about connection management. In the IBuySpy 

examples, the connections are closed explicitly only in a few occasions. I 

got the impression that ADO.NET takes some care of the connections and got 

confused to use some connection optimizations because I am uncertain 

whether the ADO would not close my connection automatically.



> Until i hear differently, I'm going to continue to open a connection, 

get/update my

> data and then close it.  AFAIK, ADO.Net doesn't do anything spectacular 

with

> connection management in the area.  ADO.Net has those datasets which 

make it nice

> for quick lookups, so once you fill your dataset, you can close your 

connection and

> then just go through your data clientside.  Datasets can show multi-table

> relationships and keep those enforced, so once you get your data into 

them, there's

> almost no need to go back to the database.

> 

> good luck,

> 

> john



Message #4 by "Richard Anderson" <rja@a...> on Tue, 22 May 2001 21:17:01 +0100
It's good practise when using ADO.NET managed providers to always call

Close, and do it as soon as you can.  That way the connection is either

closed sooner, or returned to the connection pool sooner, depending on the

managed provider used (if I recall in beta1 the sql server managed provider

didnt support connection pooling).   In beta2 both of the managed providers

support connection pooling.



hth,



Rich.



----- Original Message -----

From: "Hristo Hristov" <nohaber@h...>

To: "ASP+" <aspx@p...>

Sent: Tuesday, May 15, 2001 8:32 AM

Subject: [aspx] Re: connection closing in asp.net





> Thanx for the reply John,

> but I am still not sure about connection management. In the IBuySpy

> examples, the connections are closed explicitly only in a few occasions. I

> got the impression that ADO.NET takes some care of the connections and got

> confused to use some connection optimizations because I am uncertain

> whether the ADO would not close my connection automatically.

>

> > Until i hear differently, I'm going to continue to open a connection,

> get/update my

> > data and then close it.  AFAIK, ADO.Net doesn't do anything spectacular

> with

> > connection management in the area.  ADO.Net has those datasets which

> make it nice

> > for quick lookups, so once you fill your dataset, you can close your

> connection and

> > then just go through your data clientside.  Datasets can show

multi-table

> > relationships and keep those enforced, so once you get your data into

> them, there's

> > almost no need to go back to the database.

> >

> > good luck,

> >

> > john

>

>

> ---

> SoftArtisans helps developers build robust, scalable Web applications!

> Excel Web reports, charts: http://www.softartisans.com/excelwriter.html

> File uploads: http://www.softartisans.com/saf.html

> Transactional file management: http://www.softartisans.com/saf1.html

> Scalability: http://www.softartisans.com/saxsession.html

> ASPstudio value pack: http://www.softartisans.com/aspstudiosuite.html




>




  Return to Index