Cache Lost

Mar 4, 2009 at 10:06 AM
Hi,

I've problem! I've restart my win2k3 Server and I lost all cache saved! Why? 
It's possible to recover cache after reboot?


Thanks!
Coordinator
Mar 4, 2009 at 4:00 PM
hi,

in general it's only possible to cover this scenario with replicated caching as long as
you not reboot both servers. in normal single mode this is currently not supported.

would you be interessted to implement something like this? i would help you in case you able to write the code which is fairly not too much to do since you can save all cached data upon shutdown to a file an after onload you simply can check if this file is available and load it into cache.

regards, roni    
Mar 4, 2009 at 4:59 PM
I'm in normal single mode, as you said!

I need to retrieve all data cached after reboot! Could you hel me? How can I do this?

Thanks very much for your attention.

Bye.
Coordinator
Mar 4, 2009 at 5:29 PM
hi,

in generall you would have to make the following:

1) Init() Method needs to be extended by a load data from file:
public void Init() -> ServiceLogic.cs
after everything is loaded you can read all data from your file and load it into cache.

2) ShutDown() Method you need to save data from your cache
public void ShutDown() -> ServiceLogic.cs

before you really shutdown the server you would have to read all data from SharedCache.WinServiceCommon.Cache and save it to a file.

this is in general what you have to do.

use case you do not have to consider about, in case you have added an object for 5 min. and during your restart the object will be expired then you load
this item into cache but if you try to access it it will return NULL. Upon next cleanup it will remove all expired objects.

do you understand what I mean?

in case you can wait i will be able to help you but it will take some time +/- 3 - 4 weeks.

regards, roni

 

 

 

 

Mar 4, 2009 at 11:51 PM
If you are depending on items being in the cache, you are doing it wrong. The cache isn't a datastore, it is temporary in-memory storage place to increase performance. Every call to the cache needs to have a fallback to query the actual datasource and repopulate the cache if it isn't in the cache already.
Coordinator
Mar 5, 2009 at 5:07 PM
in general i agree but since he does not mention his usecase or the application i only can give suggestions.

regards,roni            
Mar 9, 2009 at 7:52 AM
Edited Mar 9, 2009 at 7:53 AM
I have in cache only data that doesn't change for a long time!

If I'll wait 3-4 week you'll add this feature in the next release?

Thanks for all your patiente!!!

Bye!
Coordinator
Mar 9, 2009 at 8:17 AM
hi,
can you open a new item within the issue tracker were you describe your exact needs and maybe your specfic use-case?
the next release 3.0.5.1 will be deployed as soon as possible and your feature request will be added into version: 3.0.5.2.

regards, roni
Mar 9, 2009 at 4:46 PM
If you do add this as a feature, please leave it off by default. Also I think this is not the way to solve the problem you have. While the cache server is off the value could have changed and notifications would have already been sent to the cache server (which is down) telling it to blast values that have changed. If they don't change very often, fine, but if they happen to change when you reboot the server you won't have any way of refreshing them if it keeps reloading old values.
Coordinator
Mar 9, 2009 at 8:01 PM
I agree a 100% percent - it will be disabled by default. this feature will be the basic for session states, therefore it's on my pipeline. regards
Apr 6, 2009 at 9:26 AM
Are there news?

Thanks.
Coordinator
Apr 6, 2009 at 9:31 AM
i have firstly to finish some additional stuff for the upcoming release.
Apr 6, 2009 at 9:43 AM
ok, thanks!