Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Design Tip needed

Status
Not open for further replies.
Jun 26, 2000
28
GB
Hi,<br>I'm writing a data imput system to move data from a paper form into a database. It will be based on a companies intranet.<br>The form is rather long and complicated so i have split the entry of the data up into several screens each has its own html form which passes the info to an asp for validation and entry into the database. <br><br>As a result of this i have am opening and closing a database connection object for each page which i assume to be quite expensive. <br><br>Does anyone have any opinion on using one connection object and keeping it open across all of the pages?<br><br>cheers<br><br>Pat
 
PatHastings:<br><br>Doing great job.<br><br>It is always recommeded open a connection&nbsp;&nbsp;and close and set = nothing before moving to new page.<br><br>Server is having pool of connection they will give one as&nbsp;&nbsp;requested by page. but if you are closing and set rs = nothing them sever will think you are still using and will not allot to any one. page taking server resources through it don't need. if any new request will come the he will open new set of connection for them. so it always good open use and close it.<br><br>Hope i am able to give some light in topic.<br><br>Anand
 
Dear Pat,<br><br>&gt; Does anyone have any opinion on using one connection object and keeping it open across all of the pages?<br><br>Microsoft does. They say don't do it, they even explain why and it makes perfect sense. You can find the relevant articles at msdn.microsoft.com<br><br>SQL Server provides connection pooling. So if your user submits the next form before the pooled connection times out and is released, they will just get the same connection back again anyway. The timeout is set in the DTC management console I think, or maybe in the IIS management console. I think it defaults to 60 seconds. You can raise it if you like. Also you can break up your forms into smaller pages so that the user can finish and submit each one reasonbly soon enough to avoid the time out. Of course if your site is real busy the connections never timeout because every visitor is sharing the pooled connections.<br><br>Do you need to transaction the entries accross pages, or is it not neccessary to your solution?<br><br>Good luck<br>-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top