Session and Database Connection, Which Is More Costy?
- From: gnewsgroup <gnewsgroup@xxxxxxxxx>
- Date: Fri, 09 Nov 2007 15:32:07 -0000
I am just curious about this issue.
I have a few buttons on a single aspx page. Each time one of the
buttons is clicked, I need to know if a customer has an unpaid
balance.
I only know of 2 ways to handle this:
1. Open the database connection only when the page is loaded the first
time, check the database for unpaid balance and save it as a session
variable. (Thus avoiding repetitive db connections.)
2. Upon clicking of each button on the page, I open up the database
and check the database for unpaid balance. (Thus avoiding session
variables.)
I heard through the grapevine that database connection is costy. In
the same manner, I heard that session will cause a scalability
problem.
So, in situations like this, what factors help us decide which
strategy to use?
Also, how about saving the value in a hidden field?
.
- Follow-Ups:
- Re: Session and Database Connection, Which Is More Costy?
- From: Roland ***
- Re: Session and Database Connection, Which Is More Costy?
- From: bruce barker
- Re: Session and Database Connection, Which Is More Costy?
- From: sloan
- Re: Session and Database Connection, Which Is More Costy?
- From: Jonathan Wood
- Re: Session and Database Connection, Which Is More Costy?
- Prev by Date: Re: Export aspx/vb .net to multi-tabbed Excel?
- Next by Date: Re: I feel it makes sense NOT to use custom membership & role provider
- Previous by thread: using custom database for membership and rolls ?
- Next by thread: Re: Session and Database Connection, Which Is More Costy?
- Index(es):
Loading