|
-
Aug 23rd, 2005, 03:05 PM
#1
Thread Starter
Junior Member
Doh! Shared variables have ASP Application scope!!
Doh, I'm converting alot of our existing ASP to ASP.NET. I have been using shared variables and custom collections to save on database hits. Like this:
A Reseller has Customers, and a Customer has Domains, and a Domain has one ParentDomain (self referencing relationship in the database), and a Domain is on a Server. The number of database queries get crazy/repetitive when all the Domains are referencing the same ParentDomain and Server. To save on all the repetitive database hits, I had a shared collection, which instead of creating a new object would return a reference to the existing Domain or Server.
Since I'm only working on my local machine there has been no problem. But today I learned that shared variables are at the Application scope. I had been assuming they would be page scope or maybe session.
Now I'm faced with completely redoing my data access scheme to return datareaders or datasets instead of custom collections, or passing around a reference to some sort of global collection when creating objects.
Any ideas on options? The latter is closest to what I am trying to acheive, but sounds pretty messy.
Thanks,
Jamison
Last edited by jamison; Aug 23rd, 2005 at 03:09 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|