473,378 Members | 1,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Best Practice

I am creating an aspx process to read rows from a table, display specific
fields, wait for the administrator (the only user of this process) to decide
what action to take based on the data and then delete the row and move on to
the next one. Each row in that table represents a request by a user for a
change to their subscription status (change address, new request, delete
etc.). The administrator usually takes less than a minute to decide whether
to accept the request or to reject it (we are trying to prevent someone for
entering bogus information, profanity, etc.)

Is it best to keep the connection open during the process of stepping
through the rows or to "open - display the data - close" and wait for the
administrator to decide the action to be taken and then re-open the
connection, delete the row just processed and then deal with the next row?
It seems like a lot of open/retrieve/close (there are usually a couple of
hundred rows to process)

Any suggestions appreciated.

Wayne
Nov 19 '05 #1
3 1277
If I understand you correctly you have described the following scenario:
The administrator loads a page that displays a single request and takes an
action on it. When the form posts back, the next request is displayed, and
so on.

How about having a page that displays all of the requests with a mechanism
for taking the appropriate action for each request and doing all of the
updates/edits/deletes as a batch therefore eliminating many of the HTTP
requests?

The Web is a stateless environment there's no good [effective] way to keep a
connection open between page requests. When the server has finished
building/rendering the page, "everything" associated with the page will go
out of scope. If you leave a connection open when it goes out of scope, you
have [most likely] accomplished nothing more than creating a connection leak
which will gradually kill the performance of your application.

HTH
----------------
Dave Fancher
http://davefancher.blogspot.com

"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:eR**************@TK2MSFTNGP14.phx.gbl...
I am creating an aspx process to read rows from a table, display specific
fields, wait for the administrator (the only user of this process) to
decide
what action to take based on the data and then delete the row and move on
to
the next one. Each row in that table represents a request by a user for a
change to their subscription status (change address, new request, delete
etc.). The administrator usually takes less than a minute to decide
whether
to accept the request or to reject it (we are trying to prevent someone
for
entering bogus information, profanity, etc.)

Is it best to keep the connection open during the process of stepping
through the rows or to "open - display the data - close" and wait for the
administrator to decide the action to be taken and then re-open the
connection, delete the row just processed and then deal with the next row?
It seems like a lot of open/retrieve/close (there are usually a couple of
hundred rows to process)

Any suggestions appreciated.

Wayne

Nov 19 '05 #2
Open and close the connection as often as you want. Don't worry about it.
ADO.NET has built in connection pooling so connections are managed quite
efficiently no matter what you do - unless you hold open connections for
long periods of time.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:eR**************@TK2MSFTNGP14.phx.gbl...
I am creating an aspx process to read rows from a table, display specific
fields, wait for the administrator (the only user of this process) to
decide
what action to take based on the data and then delete the row and move on
to
the next one. Each row in that table represents a request by a user for a
change to their subscription status (change address, new request, delete
etc.). The administrator usually takes less than a minute to decide
whether
to accept the request or to reject it (we are trying to prevent someone
for
entering bogus information, profanity, etc.)

Is it best to keep the connection open during the process of stepping
through the rows or to "open - display the data - close" and wait for the
administrator to decide the action to be taken and then re-open the
connection, delete the row just processed and then deal with the next row?
It seems like a lot of open/retrieve/close (there are usually a couple of
hundred rows to process)

Any suggestions appreciated.

Wayne

Nov 19 '05 #3
Thanks for the advice. I guess I'll do the open/close as suggested. I cant
really create a list for the administrator to work from as there are too
many fields that need to be viewable.

Wayne

"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:eR**************@TK2MSFTNGP14.phx.gbl...
I am creating an aspx process to read rows from a table, display specific
fields, wait for the administrator (the only user of this process) to decide what action to take based on the data and then delete the row and move on to the next one. Each row in that table represents a request by a user for a
change to their subscription status (change address, new request, delete
etc.). The administrator usually takes less than a minute to decide whether to accept the request or to reject it (we are trying to prevent someone for entering bogus information, profanity, etc.)

Is it best to keep the connection open during the process of stepping
through the rows or to "open - display the data - close" and wait for the
administrator to decide the action to be taken and then re-open the
connection, delete the row just processed and then deal with the next row?
It seems like a lot of open/retrieve/close (there are usually a couple of
hundred rows to process)

Any suggestions appreciated.

Wayne

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
17
by: | last post by:
I have an app that retrieves data from an Access database. At the moment I have the SQL string as a Const in my app. I understand this is not best practice. I don't want the user to have access to...
8
by: Fredrik Melin | last post by:
I have a "Inventory" Object that contains the product and all its fields. The problem is that I am getting soooooo many functions under main Inventory class so it becames impossible to initalize...
10
by: Ren | last post by:
Hi All, I'm still rather new at vb.net and would like to know the proper way to access private varibables in a class. Do I access the variable directly or do I use the public property? ...
10
by: Jay Wolfe | last post by:
Hello, I'm trying to make sure I use best practices (and hence save myself some headaches) with the declaration and definition of global variables. Let's say I have an app with 30 files,...
4
by: Ned Balzer | last post by:
Hi all, I am pretty new to asp.net; I've done lots of classic asp, but am just beginning to get my mind wrapped around .net. What I'd like to do is include some code that tests if a user is...
2
by: MikeG | last post by:
When creating a class library is it wrong or not a 'Best Practice' to reference a property of an object from within a constructor or method of that object? I recall being told not to do this but I...
2
by: kbutterly | last post by:
All, I have a menu which contains Category as the master and Product as the child. When I click on a Category in the menu, I want one formView control, fvpc, to show, and then when I click on...
9
by: =?Utf-8?B?QW1tZXI=?= | last post by:
I've read many incomplete opinions about the "Best Practice" for securely accessing SQL but what I really need to find the "Best Practice" that fits my applications needs. Currently (alpha...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.