Caching for multiple users without using store

Topics: Caching Application Block
May 19, 2009 at 4:29 PM

I've found that in my current web project (VS2008, C#, enterprise lib 4.1, with DB2 backend) some users are opening multiple tabs and logging in as different users.  My current implementation of the EntLib cache is using memory based storage and it's working great with one user/one browser tab.  Problem occurs when the second tab is opened, another instance of the app is started and another user logs in .   The tab that is currently being used is the one that sets the cache values that are being read by both.  Obviously, this creates issues when the user changes tabs and trys to get the correct info for the original user.  Is there a way to continue memory based cache where I can have multiple users each have their own separate cache?  I've read about isolated storage and I'm not sure if this is what it sounds like to me, but I'm trying to stay away from the database too.

Any thoughts or suggestions are greatly appreciated!

May 20, 2009 at 3:52 AM

Why not implement session/user-based keys?  Prefix your cache item keys with the current username or sessionid.

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.

entlib.support@avanade.com

May 22, 2009 at 1:05 AM
How can you incorporate enumeration with the EntLib Cache?

Thank you,
Richie Rubin
Infinity Interactive Solutions, LLC
18015 19th Avenue North
Plymouth, MN  55447
P: 952-451-3004
F: 866-424-9905



------------------------------------------------------------------------------
Electronic Privacy Notice. This e-mail, and any attachments, contains information that is, or may be, covered by electronic communications privacy laws, and is also confidential and proprietary in nature. If you are not the intended recipient, please be advised that you are legally prohibited from retaining, using, copying, distributing, or otherwise disclosing this information in any manner. Instead, please reply to the sender that you have received this communication in error, and then immediately delete it. Thank you in advance for your cooperation.


On Tue, May 19, 2009 at 9:53 PM, AvanadeSupport <notifications@codeplex.com> wrote:

From: AvanadeSupport

Why not implement session/user-based keys?  Prefix your cache item keys with the current username or sessionid.

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.

entlib.support@avanade.com

Read the full discussion online.

To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)

To start a new discussion for this project, email entlib@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


May 22, 2009 at 3:08 AM

I'm not sure on what you're asking, is it still related to your first question?  Could you be more specific on how you want to use enumeration with CAB? 

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.

entlib.support@avanade.com

May 22, 2009 at 3:36 AM
My original question was regarding having multiple users within one IE (or FF, or Opera, etc...) session overwriting cache values.  I'm going to concatenate the userID before the cache value to create a unique key, so this issue is solved.   My current issue now is to delete all of a specific user's keys, without deleting any others.   Seeing I don't know the specific key values that will exist, nor how many, I was hoping to enumerate through any/all values at look for the specific userID, deleting as I find them.  Not sure how I can do this seeing there's no Items property to enumerate through.  Does this now make sense?
 
From what I've read it seems that System.Web.Cache (I think this is the namespace) has the ability to use a dictionary method to enumerate though.  Not sure about the specifics of how this would work seeing I don't have it in front of me.  I would think that the EntLib would have all of these options too, seeing they're supposed to make coding easier.  I can't be the only person who would want to do this.... 
 
Does this make sens?

Thank you,
Richie Rubin
Infinity Interactive Solutions, LLC
18015 19th Avenue North
Plymouth, MN  55447
P: 952-451-3004
F: 866-424-9905



------------------------------------------------------------------------------
Electronic Privacy Notice. This e-mail, and any attachments, contains information that is, or may be, covered by electronic communications privacy laws, and is also confidential and proprietary in nature. If you are not the intended recipient, please be advised that you are legally prohibited from retaining, using, copying, distributing, or otherwise disclosing this information in any manner. Instead, please reply to the sender that you have received this communication in error, and then immediately delete it. Thank you in advance for your cooperation.


On Thu, May 21, 2009 at 9:08 PM, AvanadeSupport <notifications@codeplex.com> wrote:

From: AvanadeSupport

I'm not sure on what you're asking, is it still related to your first question?  Could you be more specific on how you want to use enumeration with CAB? 

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.

entlib.support@avanade.com

Read the full discussion online.

To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)

To start a new discussion for this project, email entlib@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


May 22, 2009 at 3:43 AM

Enumerating  items in the CacheManager is not supported in EntLib. Refer to this FAQ item - http://entlib.codeplex.com/Wiki/View.aspx?title=How%20do%20I%20enumerate%20items%20in%20a%20CacheManager%3f&referringTitle=Home

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.

entlib.support@avanade.com

May 22, 2009 at 4:15 AM
Thanks for your help!

Thank you,
Richie Rubin
Infinity Interactive Solutions, LLC
18015 19th Avenue North
Plymouth, MN  55447
P: 952-451-3004
F: 866-424-9905



------------------------------------------------------------------------------
Electronic Privacy Notice. This e-mail, and any attachments, contains information that is, or may be, covered by electronic communications privacy laws, and is also confidential and proprietary in nature. If you are not the intended recipient, please be advised that you are legally prohibited from retaining, using, copying, distributing, or otherwise disclosing this information in any manner. Instead, please reply to the sender that you have received this communication in error, and then immediately delete it. Thank you in advance for your cooperation.


On Thu, May 21, 2009 at 9:43 PM, AvanadeSupport <notifications@codeplex.com> wrote:

From: AvanadeSupport

Enumerating  items in the CacheManager is not supported in EntLib. Refer to this FAQ item - http://entlib.codeplex.com/Wiki/View.aspx?title=How%20do%20I%20enumerate%20items%20in%20a%20CacheManager%3f&referringTitle=Home

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.

entlib.support@avanade.com

Read the full discussion online.

To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)

To start a new discussion for this project, email entlib@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com