a little test with 3.0.5

Topics: User Forum
Jan 21, 2009 at 8:34 AM

I'm doing a litle 'stupid' test with 3.0.5 on my local PC as follow:

for i = 1 to 30
    ' insert i to cache
    ' read i immediately from cache

and 11 of 30 item is failed (unable to get the value from cache).

However, same testing with is 100% success.

Any idea?

Jan 21, 2009 at 10:42 AM
hi, do you have some code you can post?

did you tried to run provided console application?

are you sure you have defined only one server in your client configuration?

feel free please to post code or even to send your test project to sharedcache {at} sharedcache {dot} com

Jan 21, 2009 at 11:04 AM
yup, i have only one server my config.

the code ..

Imports SharedCache.WinServiceCommon.Provider.Cache
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim i As Integer = 0
        Dim strResult As String = String.Empty
        For i = 1 To 30

            IndexusDistributionCache.SharedCache.Add("cache1-" & i.ToString, "Hello " & i)

            strResult = IndexusDistributionCache.SharedCache.Get("cache1-" & i)
            If strResult Is Nothing Then
                strResult = "N/A"
                j += 1
            End If
            Debug.Print("GET... " & strResult)
        Next i

        Debug.Print("failed ... " & j)
    End Sub

in average I have 11 items failed - but none if im using

Jan 21, 2009 at 1:23 PM

i created a small project which is available here: http://uploading.com/files/L4WI2TII/ConsoleTest%20-%20Sc_3.0.5.0.zip.html it seems you have to enjoy adverts for some seconds before you can download it but i do not have access to a better location to upload it now.



void Main(string[] args)




Console.WriteLine("Start Test");



Console.WriteLine("Clear Cache");






for (int i = 0; i < 30; i++)




Console.Write("Add Data " + i.ToString() + ": ");



string dataToAdd = string.Format("some numers to add, {0}, {1}, {2}", i, i*4, i*5);



string key = "cache1-" + i.ToString();



CACHE.SharedCache.Add(key, dataToAdd );



string recievedData = CACHE.SharedCache.Get<string>(key);










List<string> keys = CACHE.SharedCache.GetAllKeys();



Console.WriteLine("Receiving all Keys from Cache {0}", keys.Count);



foreach (var item in keys)




string recievedData = CACHE.SharedCache.Get<string>(item);



Console.Write("Data for key: {0} is: {1}", item, recievedData);













Console.WriteLine("Clear Cache");



Console.WriteLine("End Test");







please let me know if you have the same problem here. did you checked your logfiles?            


Jan 22, 2009 at 8:26 PM
hi, wanted to ask if you figured out your issues you had? could you run the sample i sent you?

regards, roni
Jan 28, 2009 at 4:43 AM
Hi, Sorry for the long pause.

I can run your code successfully and re-run my previous app with no problem. Now switching to 3.0.5  :D.