views:

122

answers:

2

Hi, maybe the question is wrong but here is what i want to achieve maybe there is other way to do that.

I have ASP.NET application running .net 3.5, there is a client list and few others List based objects that are shared among all users of application. ie. when client logged in his userID and few other properties are saved within some List in Application state. Problem is that this application is heavy and it's application pool needs to be restarted once a day or so so all the information saved in these List objects is lost. While client personal data which is saved in Out-of-Proc mode on external server is saved.

Is there any way to workaround it ? Shared Session? Something like that.

PLEASE NO MSSQL SOLUTIONS...

Cheers, pros !!!!

+1  A: 

Have you looked at caching the lists of data?

This SO article has some good detials.

Keith Bloom
cheers, seems more or less what i was looking for
eugeneK
+1  A: 

You should only use Application State as a cache for data persisted elsewhere. You would then use Application_Start or some Lazy loading wrapper class to retrieve such persisted data into the application object.

If you are storing volatile data not persisted elsewhere in the application object then you are in trouble. Hopefully you would have abstracted access to the application object behind some wrapper object so that all your code is accessing the wrapper not tha application object. Now you would need to ensure the modifications are saved elsewhere so that they can be recovered on restart.

To be frank the Application state object is really an aid in porting ASP-Classic sites. Since you should really just treat the application state as a cache, there is an overlap in functionality between it and the ASP.NET Cache object.

AnthonyWJones
So you suggest to save in in Cache and what happens when application pool recycles ?
eugeneK
I'm not suggesting that using Cache solves your issue with pool recycles, I'm just pointing out that there is an overlap here. You need store shared data in some non-volatile place and load it into the application or cache either at app start or on-demand. If your code modifies the data it needs persist it back to the non-volatile store. If you ever want to support Web Garden or Farms using the Cache would be better since you can create SQL or File dependencies on cached items.
AnthonyWJones