473,387 Members | 1,416 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

2 questions re data caching and session objects

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
2 1239
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
thanks for the advice what you have said makes a lot of sense to me

Nov 18 '05 #3

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

Similar topics

2
by: Victor Fees | last post by:
I have a general question for which I would like to get some general input from the online community. I'm building an asp.net web application that will make extensive use of a SQL Server 2K...
9
by: JohnSouth104 | last post by:
Hi I've an asp.net, c#, sql server website and the volumes are starting to rise quickly. I've been asked to look at improving the memory usage of the application. I've not looked at this before...
4
by: Guadala Harry | last post by:
Is there any way for one Session to remove and update objects in another Session? I seriously doubt it, but thought I'd ask. Here's why: I have some data that is unique per user (or per session -...
2
by: Wysiwyg | last post by:
I was hoping to get some opinions on the efficiency of various methods of reusing the same dropdown list data. Here is the situation: Multiple panels on maintenance pages with TAB menus across...
2
by: baffled | last post by:
I have both datatables and custom objects that are specific to a session and need to be cached for such things as paging, sorting, etc... As far as I can tell, there would be 2 basic ways to do...
5
by: Stan SR | last post by:
Hi, Some newbie questions.. :-) First, what is the namespace to use for the Cache class ? When I use this bit of code I get an error if (Cache==null) Cache.Insert("myUserList",userlist);...
3
by: at_the_gonq | last post by:
Hello, I am hoping to get some guidance on the following scenerio: I have a password protected site where users have various permissions. Are sessions the best way of storing the user's id? ...
6
by: =?Utf-8?B?QW1pciBUb2hpZGk=?= | last post by:
Hi Our application was using Session variables to store business object for our Web Forms successfully until someone opened a cloned IE window using Control-N key press. The cloned window...
8
by: Brock | last post by:
I am trying to populate a Crystal Report from data in my DataGrid. The reason for this is that I want the user to be able to change values without updating the database, but still have their report...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.