Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / June 2006

Tip: Looking for answers? Try searching our database.

Error with partitioned session

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Demi - 28 Jun 2006 21:33 GMT
Running ASP.NET2.  Every once in a while I get this error:

Unable to cast object of type 'System.Collections.DictionaryEntry' to type
'System.Web.PartitionInfo'.

  at System.Web.PartitionManager.Dispose()
  at System.Web.SessionState.SqlSessionStateStore.OnAppDomainUnload(Object
unusedObject, EventArgs unusedEventArgs)

I setup a partitioned session db by overriding
System.Web.IPartitionResolver and using a simple hash to return an index in
a list of connection strings.

       public String ResolvePartition(Object key)
       {
           String sid = (String)key;

           // hash the incoming session ID into
           // one of the available partitions
           int partitionID = Math.Abs(sid.GetHashCode()) % partitions.Length;

           return partitions[partitionID];
       }

I did it based on the article here:
http://msdn.microsoft.com/msdnmag/issues/05/09/SessionState/default.aspx#S8
and just did the sessiondb instead of the session state server.  As I said
works fine most of the time but throws the above exception once in a while.
Demi - 28 Jun 2006 21:41 GMT
Very repeatable.  If I change web.config to force the appdomain unload, this
happens.

> Running ASP.NET2.  Every once in a while I get this error:
>
[quoted text clipped - 24 lines]
> and just did the sessiondb instead of the session state server.  As I said
> works fine most of the time but throws the above exception once in a while.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.