By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,666 Members | 1,924 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,666 IT Pros & Developers. It's quick & easy.

2 questions re data caching and session objects

P: n/a
2 questions please:

1. At the moment I make a connection to a database whenever a user
logs into my website. I run a few SQL's then store some commonly used
dataTables in session objects for quick access throughout my
application.

I am not caching my dataTables because each of my users are directed
to their own individual company databases. So the contents of these
dataTables will differ from user to user. I have read that data
caching exists only at the application level so I am assuming that I
could only cache these dataTables if my users were connecting to the
same database and therefore had the same data within these
dataTables. Is that correct please?

2. Let's say Joe Bloggs from Company A connects to my website. I store
some commonly used dataTables for that user inside a session objects.
Some of the dataTables are specific to that user so this is OK.
However other dataTables are generic for Company A.

Would it be possible to implement logic that would store certain
dataTables inside session objects on a per user basis, but store
other dataTables inside session objects on a per company basis?

p.s. I do not say on an application level basis here because, as per
question 1, I will have users logging in from different companies to
my application who will need to store completely different data.

many thanks.

Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
The Cache is application wide, but you store and retrieve items based
on a key. By putting a company identifier into the key, you could
cache inforormation for each company of users, i.e:

string cacheKey = companyId + tableId;

Cache.Insert(cacheKey, dataTable);
HTH,

--
Scott
http://www.OdeToCode.com

On 12 May 2004 16:01:43 -0500,
ma***********@yahoo-dot-com.no-spam.invalid (Wee Bubba) wrote:
2 questions please:

1. At the moment I make a connection to a database whenever a user
logs into my website. I run a few SQL's then store some commonly used
dataTables in session objects for quick access throughout my
application.

I am not caching my dataTables because each of my users are directed
to their own individual company databases. So the contents of these
dataTables will differ from user to user. I have read that data
caching exists only at the application level so I am assuming that I
could only cache these dataTables if my users were connecting to the
same database and therefore had the same data within these
dataTables. Is that correct please?

2. Let's say Joe Bloggs from Company A connects to my website. I store
some commonly used dataTables for that user inside a session objects.
Some of the dataTables are specific to that user so this is OK.
However other dataTables are generic for Company A.

Would it be possible to implement logic that would store certain
dataTables inside session objects on a per user basis, but store
other dataTables inside session objects on a per company basis?

p.s. I do not say on an application level basis here because, as per
question 1, I will have users logging in from different companies to
my application who will need to store completely different data.

many thanks.


Nov 18 '05 #2

P: n/a
thanks for the advice what you have said makes a lot of sense to me

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.