Groups | Blog | Home
all groups > dotnet remoting > march 2007 >

dotnet remoting : Cached Data through .NET Remoting


Greg
3/20/2007 9:32:45 PM
Hi,

I am looking to build a solution whereas I load a large dataset via a
Windows Service and then make that dataset available to my other
applications via .NET Remoting. My other applications connect through
web services and loading the data over and over again is a lot of
resources and adds a time expense to each call.

When I went to implement the solution I found that everything worked
fine, except that when my application remoted into the windows
service the first time the remoting object was actually loading the
data. After the initial call the time to query the data dropped (from
8 seconds to 1 second). I am trying to avoid the first call and any
subsequent call from taking 8 seconds or longer.

But shouldn't my application be able to query the windows service for
the already loaded data in 1 second? The windows service shows it is
loading the data.

Is this possible via .NET Remoting or should I be looking at another
option. I have opted to serialize the data to disk and have my
applications pick up the serialized dataset (this takes about 2
seconds)... however I would like to have this work through remoting.

I have not used .net remoting that much so I may have missed something
when I initially wrote the solution.

Any suggestions or comments are welcome.

Greg
Rowen
3/20/2007 10:56:11 PM
Is it is a singleton object, the remote object is only created when
the client connects to it for the first time.

If you are loading the data on class initialise, then this is why you
are experiencing the initial delay. However this is not really a
problem once the service is up and running. The problem you will have
is determining when the data will be refreshed and how to refresh it.

I'm not sure if this is the solution you are looking for (or what you
have implemented) but perhaps on the windows service start up you
should load the data into a dataset. The remote object should not load
this dataset, but rather the windows service itself. The remote object
merely returns the dataset to the calling client. You will then have
tom implement rules as to how the dataset will be refreshed, such as a
timer in the windows service application.

Regards,

Rowen


[quoted text, click to view]
AddThis Social Bookmark Button