473,587 Members | 2,496 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cache object problem.

Hi,
I have problem related to Caching of data. I am reading large xml
file and putting this xml in dataset, since this dataset will contain
many datatable's inside. And each datatable might be big in data. Each
user will contain its seperate xml file, so when I create xml file for
each user, I am putting this xml DataSet in Cache object, but when I
try to populate my controls using Cache object, I am faching weired
problem. As some times it populates the controls and some times it
doesnt, although the xml files have been created for that user.
Along with this I am using same cache object name for every user.

So please tell me what could be the reason for cache is not able to
populate the controls on some time.???and what could be best usage for
concurrent users??Sessions or Cache??

Thanks in Advance.
Manoj Singh

Sep 21 '06 #1
3 1916
Cache items are stored at the Application level, i.e. all users sharing this
space.
Session items are stored at the Session level, i.e. isolated space per user.

if you use the same name with Cache you will get confusing results. i
believe the cache allows multiple objects to be stored with the same name if
you use Cache.Add, but when you request Cache["whatever"] you can't really
expect to get the right one then.

be careful putting large datasets in memory for every user. that may scale
horribly on your server unless your number of users is fixed at a small
number.

i hope this helps
tim

"Aryan" <ma*********@gm ail.comwrote in message
news:11******** **************@ d34g2000cwd.goo glegroups.com.. .
Hi,
I have problem related to Caching of data. I am reading large xml
file and putting this xml in dataset, since this dataset will contain
many datatable's inside. And each datatable might be big in data. Each
user will contain its seperate xml file, so when I create xml file for
each user, I am putting this xml DataSet in Cache object, but when I
try to populate my controls using Cache object, I am faching weired
problem. As some times it populates the controls and some times it
doesnt, although the xml files have been created for that user.
Along with this I am using same cache object name for every user.

So please tell me what could be the reason for cache is not able to
populate the controls on some time.???and what could be best usage for
concurrent users??Sessions or Cache??

Thanks in Advance.
Manoj Singh

Sep 21 '06 #2
Thanks Tim,
I am using Cache.Insert() and setting sliding expriation and
dependancy. But the problem is, I am using the same Cache key for every
user, although each user will have his different xml file. So my
confusion was, right now I am testing my application with single user,
which creates only single xml file. But in this case also why my
controls are not populating sometimes and sometimes it does populate
nicely..
Can you please suggest me what could be the probable reason for the
same.

Thanks Again,

Sep 22 '06 #3
hi Aryan,
yes i understand your problem. you are accidentally overwriting cache values
between users.

if you don't like using Session objects, or if you really need the Sliding
expiration, or CacheDependency , you could use a key naming convention of the
form <Username>_<Key Name>.

this should do it for you.

tim
"Aryan" <ma*********@gm ail.comwrote in message
news:11******** **************@ d34g2000cwd.goo glegroups.com.. .
Thanks Tim,
I am using Cache.Insert() and setting sliding expriation and
dependancy. But the problem is, I am using the same Cache key for every
user, although each user will have his different xml file. So my
confusion was, right now I am testing my application with single user,
which creates only single xml file. But in this case also why my
controls are not populating sometimes and sometimes it does populate
nicely..
Can you please suggest me what could be the probable reason for the
same.

Thanks Again,

Sep 22 '06 #4

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

Similar topics

5
1504
by: Florian Lindner | last post by:
Hello, I am building a object cache in python, The cache has a maximum size and the items have expiration dates. At the moment I'm doing like that: cache = {} # create dictionary cache = (object, timestamp) # Save a tuple with the object itself and a timestamp (from datetime.datetime.now()) under a unique object ID. This make looking up...
0
1178
by: Neil Kimber | last post by:
Hi, I'm using the Cache object to persist some values between pages. I'm setting the expiration for 2 minutes. I'm actually storing Bitmap streams in the cache. In this way, one page can draw an image and store it and another page can be responsible for streaming it to the browser. This approach works well in that the Bitmap is correctly...
1
2500
by: Joe Fallon | last post by:
I am trying to setup a cache that refreshes itself every hour. (My sample code is for every minute so I can test it.) I have found some examples that I thought worked but they all seem to fail. (They only work when I click the submit button - not when the cache expires.) In my Login form I have: Global.AddItemToCache("CacheTime", Date.Now,...
1
3168
by: Glenn | last post by:
Hi, I have a config XML file that I am using from the application cache. I have configured the entry with a remove callback to re-populate cache automatically when the XML file changes. All is well until the XML file is changed. The cached item is being removed as I would expect, but the remove callback is not firing at all, hence a...
4
5352
by: Mat | last post by:
Hi, I've stumbled onto a problem when using the caching object in ASP.Net. I'm placing a static dataset to the cache as the data only changes once a day. Whilst writing to the cache I'm using a lock using code like below (just typed this in); Cache thisCache = HttpContext.Current.Cache lock(thisCache)
13
1773
by: Fernando Chilvarguer | last post by:
Hi, I'm retriving data from a database and storing it on the Cache Object using the following code: HttpContext.Current.Cache.Insert( cacheItemKey, contentDS, //THE DATASET WITH MY DATA null, DateTime.Now.AddSeconds(600),
1
2697
by: William Sullivan | last post by:
I'm trying to nail down some issues with the cache in my application. Currently, I have an object that stands between my business logic and database logic called CacheLogic (cute, no?). Global.asax.cs creates it in Application_Start, initializes it and places it in the cache. During initialization, CacheLogic retrieves data from the DB logic...
5
2116
by: Arjen | last post by:
Hi, I'm using the cache block of the enterprise lib Jan. 2006. There is somethings strange going on. I add a varable to the cache, let's say the string myData. string myData = "1111111"; primitivesCache.Add("Key1", myData, CacheItemPriority.Normal, null, new SlidingTime(TimeSpan.FromMinutes(15)));
2
2664
by: moondaddy | last post by:
I had to repost this because I had to update and change my msdn alias. I will re-ask the question and clarify a few things that were not clear before. This code is all executed on my dev machine running winXP sp2 and VS2005. I'm using a c# 2.0 winforms app which talks to a c#2.0 asp.net app that also contains 1 web service. Note: the...
0
7923
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7852
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8221
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5719
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.