Cache object problem.

A

Aryan

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
 
T

Tim_Mac

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
 
A

Aryan

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,
 
T

Tim_Mac

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>_<KeyName>.

this should do it for you.

tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top