search
Twitter Rss Feeds
MicrosoftArticlesForumsGroups
C# .NET
VB.NET
Visual Studio .NET
ADO.NET
Xml/Xslt
VB 6.0
.NET CF
GDI+
LINQ
Deployment
Security
FoxPro
Silverlight / WPF
Entity Framework
RIA Services

Web ProgrammingArticlesForumsGroups
JavaScript
ASP
ASP.NET
Web Services

Non-MicrosoftArticlesForumsGroups
NHibernate
Perl
PHP
Ruby
Java
Linux / Unix
Apple
Open Source

DatabasesArticlesForumsGroups
SQL Server
Access
Oracle
MySQL
Other Databases

OfficeArticlesForumsGroups
Microsoft Excel
Microsoft Word
Microsoft Powerpoint
Publisher
Money

Operating SystemsArticlesForumsGroups
Windows 7
Windows Server
Windows Vista
Windows XP
Windows Update
MAC
Linux / UNIX

Server PlatformsArticlesForumsGroups
Share Point
BizTalk
Site Server
Exhange Server
IIS
Transaction Server

Graphic DesignArticlesForumsGroups
Macromedia Flash
Adobe PhotoShop
Microsoft Expression

OtherArticlesForumsGroups
Subversion / CVS
Ask Dr. Dotnetsky
Active Directory
Networking
Uninstall Virus
Job Openings
Reviews
Search Engines
Resumes

 

Previous Thread:   IIS and Apache proxy

2/8/2006 10:01:19 AM    Shared Properties disappearing
Hi all,  
  
We have an ASP.NET 1.1 application running on IIS6 on Server 2003.  
  
Most of the base objects we are using in this application are taken from a  
  
windows application also written by us. We have used shared properties on  
  
some of these objects to enable caching of frequently used objects, so save  
  
fetching them from SQL every time. These shared properties vastly increase  
  
performance of our windows app.  
  
So in our web app, we have left the same caching technique, by using shared  
  
properties we cache various objects, usually in collections.  
  
These collections have been strongly typed by utilising seperate classes and  
  
storing an internal collection, e.g. see below.  
  
Public Class AttributeCollection  
  
Implements IEnumerable  
  
Protected intCollection As New Collection  
  
Public Overridable Sub Add(ByVal Attr As Attribute)  
  
intCollection.Add(Attr, Attr.Name)  
  
End Sub  
  
Public Sub Remove(ByVal Attr As Attribute)  
  
intCollection.Remove(Attr.Name)  
  
End Sub  
  
Public Sub Remove(ByVal AttrName As String)  
  
intCollection.Remove(AttrName)  
  
End Sub  
  
Public Function Count() As Integer  
  
Return intCollection.Count  
  
End Function  
  
Default ReadOnly Property Item(ByVal AttrName As String) As Attribute  
  
Get  
  
Return CType(intCollection.Item(AttrName), Attribute)  
  
End Get  
  
End Property  
  
Default ReadOnly Property Item(ByVal index As Integer) As Attribute  
  
Get  
  
Return CType(intCollection.Item(index), Attribute)  
  
End Get  
  
End Property  
  
Public Function GetEnumerator() As System.Collections.IEnumerator  
  
Implements System.Collections.IEnumerable.GetEnumerator  
  
Return intCollection.GetEnumerator  
  
End Function  
  
End Class  
  
The problem, is that at certain times, the cached collection returns  
  
containing nothing in the internal collection.  
  
So the shared Property is returning ok, and is pointing to one of the  
  
collections as shown above, however, the intcollection in the above code  
  
contains nothing. so the code falls over. We cannot explain why the internal  
  
collection for these objects is being emptied?  
  
Anyone any ideas?  
  
Thanks in advance and regards,  
  
Simon.


Pete's Blog   |    Pete's Resume   |    Robbe's Blog   |    Robbe's Resume   |    Archive #2   |    Archive #3   |    Dotnetslackers   |    XmlPitStop   |    Advertise   |   Contact Us   |   Privacy   |   Copyright (c) 2000 - 2009 eggheadcafe.com  All rights reserved.