I have a web application in which i cache the tables in dataset/hastables (in particular class) frequently required data.
The problem is this that if data is not in cache and two simultaneous requests come then both these requests go through DAL to database. I have implemented dal method like this that it checks for existing request placed by name of procedure, but still it
is unable to block other requests.
if data is not in cache and two simultaneous requests come then both these requests go through DAL to database. I have implemented dal method like this that it checks for existing request placed by name of procedure,
Hello:)
1)What do you mean by "data is not in cache"?
2)And what's two simultaneous requests come then both these requests go through DAL to database?
1. Data not in cache means ... the frequently requested data is saved in cache once it is fetched from server, if the erquest is the first time then this data is not present in cache. The cache is a dataset static object containing datatables.
2. Simultaneous means if from two clients on different browser access that page then these both requests first check in cache for the data required if not found then they ask DAL(data access component) to bring this datatable from sql server.
addiecarr
0 Points
3 Posts
avoiding multiple requests of same data
May 10, 2012 12:36 PM|LINK
Hello ,
I have a web application in which i cache the tables in dataset/hastables (in particular class) frequently required data.
The problem is this that if data is not in cache and two simultaneous requests come then both these requests go through DAL to database. I have implemented dal method like this that it checks for existing request placed by name of procedure, but still it is unable to block other requests.
any help or suggestion would be appreciated
thanks
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: avoiding multiple requests of same data
May 12, 2012 12:52 AM|LINK
Hello:)
1)What do you mean by "data is not in cache"?
2)And what's two simultaneous requests come then both these requests go through DAL to database?
Thanks
christiandev
Star
8607 Points
1841 Posts
Re: avoiding multiple requests of same data
May 12, 2012 08:22 AM|LINK
You want to avoid a second caller (almost calling immediately after caller one) going to fetch the same data if caller one is already en-route?
How often is the data updated in the db and where is the cached version held?
Regards, Christiandev (@chrisdev80), MCPD Web (2 & 4) & MCTS Windows (www.ScoreDonkey.com)
addiecarr
0 Points
3 Posts
Re: avoiding multiple requests of same data
May 12, 2012 07:19 PM|LINK
hi,
1. Data not in cache means ... the frequently requested data is saved in cache once it is fetched from server, if the erquest is the first time then this data is not present in cache. The cache is a dataset static object containing datatables.
2. Simultaneous means if from two clients on different browser access that page then these both requests first check in cache for the data required if not found then they ask DAL(data access component) to bring this datatable from sql server.
thanks
addiecarr
0 Points
3 Posts
Re: avoiding multiple requests of same data
May 12, 2012 07:23 PM|LINK
Hi!
Ye. you got right... the data is not so often updated in sql server but it is frequently required on page processing.
i want somehow some logic to stop 2 same requests for the same data.
thanks