Can Add byte[], but cannot Get byte[] ?

Topics: Developer Forum
Sep 20, 2010 at 2:59 PM

I am wondering why is there an option to add an byte[], but no way to return a byte[]. It always does deserialization on Get.

Im running into a case where SharedCache cannot find the object type it needs to deserialize the result into and cant seem to work around it. It would make sense to always have similar capabilities for Set/Get. I am having a more complex case with com+ and .Net intermingled :(

 

Coordinator
Sep 20, 2010 at 3:55 PM
Edited Sep 20, 2010 at 3:55 PM

no need so far :-) post me the method and filename and i will check it in.

 

greets and thanks,

roni

Sep 21, 2010 at 12:05 PM

Here it is.

IndexusProviderBase.cs:

public abstract byte[] GetBinary(string key);

IndexusSharedCacheProvider.cs:



public override byte[] GetBinary(string key)
{
	#region Access Log
#if TRACE			
	{
		Handler.LogHandler.Tracking("Access Method: " + this.GetType().ToString() + "->" + ((object)MethodBase.GetCurrentMethod()).ToString() + " ;");
	}
#endif
	#endregion Access Log

	using (IndexusMessage msg = new IndexusMessage())
	{
		msg.Hostname = this.GetServerForKey(key);
		msg.Key = key;
		msg.Action = IndexusMessage.ActionValue.Get;

		CacheUtil.Get(msg);
				
		return msg.Payload;
	}
}

Thanks,

Coordinator
Oct 15, 2010 at 10:38 AM

added the source code and checked it in.