Hi folks - hope someone can help me out with this one.
I have a system using .NET Enterprise Services in the middle tier, making
data access calls to an Sql Server. In an attempt to improve speed and
concurrency, and reduce the load on the Sql server, I am trying to make use
of a data cache in the middle tier.
This situation is this - the middler tier needs access to a certain set of
static, well structured data for almost every call made to it from the
client. So it is sensible to cache this static data so that each component
has it readily available, rather than having to always load from the db.
Note: all components will be deployed in the same COM+ application, hence
will all be running in the same DLLHost.
So static variables wont work (although I'm not entirely sure why), and the
only other way I can see to implement this is to use the Shared Property
Manager (SPM). Reading about this, it certainly does what I need. I can
serialise the static data as a simple string, and store it in the SPM for
later access by all components. Obviously this will have some CPU overhead
performing the serialisation all the time, but I can live with that.
The worry I have is that the SPM ONLY performs serialised Reads/Writes to
its data, so if I have 30 concurrent components trying to access it at the
same time, they will all get queued up. This may not be a big problem, as I
am only intending to access the SPM stored data once at the beginning of a
call, but it could cause me scalability issues.
Has anyone got any ideas on an alternative solution for this?, or any
comments on my current solution and its pros/cons
Many Thanks in advance
Klaus H. Probst - 17 Jun 2005 04:09 GMT
Hi Mark,
If you don't care about the serialization issue that much, I suggest you go
with it. There isn't a lot on Windows that can replace the SPM. One option
might be to create a separate serviced component (in another COM+
application) that uses the Enterprise Library's caching block, which frees
you from having to come up with the caching logic, and of course you get the
threading from COM+ for free as well.
I have not used EntLib like this though. I honestly have no idea what
concurrency issues you might encounter, but it seems like it could be an
easy scenario to try out. It's tricky to use EntLib in COM+, make sure you
read this:
http://groups-beta.google.com/group/microsoft.public.dotnet.distributed_apps/msg
/6192fd799b832ea4
Your only other option would be to create a Windows service using .NET that
shells out the cached data from a thread pool/singleton kind of deal.

Signature
Klaus H. Probst, MVP
http://www.simulplex.net/
> Hi folks - hope someone can help me out with this one.
> I have a system using .NET Enterprise Services in the middle tier, making
[quoted text clipped - 25 lines]
>
> Many Thanks in advance
Dan Kelley - 17 Jun 2005 11:58 GMT
You could use the Cache class in the System.Web namespace. The lcass can be
used perfectly well outside of web applications.
HTH
Dan
> Hi folks - hope someone can help me out with this one.
> I have a system using .NET Enterprise Services in the middle tier, making
[quoted text clipped - 25 lines]
>
> Many Thanks in advance