Tips for improving efficiency?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I'm soon to overhaul my asp.net 2.0's backend data source. My plans:

-To implement a data access layer
-To move from access to SQL Server 2005.

I'm going to be implementing just about every provider that microsoft ships
for sql server (membership, profile, etc).

In addition to any general advice, I've got a specific question: I've got a
page with several user controls, some of which operate on similar data. Would
it make sense to fill a dataset and then cache it somehow and pass it around?
Would this be done in the data access layer?

Thanks...

-Ben
 
Usually I have a dataset per operation. Example, if adding a customer, I
load all necessary data into this dataset and user also enters data to this
dataset. Everything is bound to this dataset...
 
Hi Ben,

According to your description, I understand that you want to know whether
it is a good solution to cache dataset in the data access layer.
If I misunderstand anything here, please don't hesitate to correct me.

As far as I know, I don't think it's a good idea to cache dataset in the
data access layer. Data access layer is only used to abstract and
encapsulate all access to the data source.
If you want to fill dataset and then cache it, we would like to suggest you
can create a new class (wrapper for the Cache object).
This class has two methods (DeCache(), EnCache()).
DeCache() method will pull a value out of the cache for a given key. If the
value doesn't exist in the cache, this method will call data access layer
to generate dataset and then cache it, return the results of this method.
EnCache() method can be used to add an item to the cache.

According to my research, we suggest you can refer the following article.
It is much closed to your scenario.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html
/aspnet-createcacheconfigobject.asp
[Creating a Cache Configuration Object for ASP.NET]

If there is anything unclear, please feel free to reply me and I'm glad to
work with you.
Happy New Year.
Wen Yuan
 
Hi Ben,

I agree with WenYuan that it's not suggested to cache a DataSet and use it
all around.

1. If there are many users connecting to your system, DataSet may be piled
up since each session many have one cached. If the size for the DataSet is
large, it may taken up resources on the server.
2. In some concurrency scenario, the cached DataSet maybe out-of-date since
the database may be changed by other users already.

If anything is unclear, please feel free to reply to this post. HTH.

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Back
Top