I have implemented a number of small caches which have not been generalized.
They Cache small numbers of codes etc, which are assumed to be constant
during the execution of the program.
I chose to implement them in data objects (usually the one which fills the
cache).
This means that the cache is duplicated for each thread.
This removes any need to waste brain time thinking about synchronization and
makes the cache very fast.
However the cost is extra time filling the cache and extra memory.
If you want to share objects across sessions you should not use session
beans, Entity beans are for this.
Since ND runs in multiple processes on different physical machines a global
cache seems problematic.
Here are some ideas:
1. GlobalSessionObjects might help you
2. If there is a lot of data and you want to access it from multiple ND
processes, put the cache in a database
Brendan Johnston
TeamND
-----Original Message-----
From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Sent: Friday, April 16, 1999 6:53 AM
To: [EMAIL PROTECTED]
Subject: Re: [ND] Implementing a Cache Manager
Curt,
Thanks for your input.
My requirement is to share the data managed by the Cache Manager
component across multiple sessions.
If possible, I would like to implement with EJB (Statefull?) but
not quite sure if EJB would be a right model to implement
a shared data service. For one, I have to ensure that there is only
one instance of this bean. Otherwise, cached data will
splitter across multiple instances of EJB (which may be running in
different JVM)...and then I have to deal with locating right
instance of bean etc.
You mentioned about data caching in ND5. Where and how is this
being done? In JDBC service?
Is PAC more appropriate model than EJB in ND5 for some thing like
this?
Raj
Curt Springer <[EMAIL PROTECTED]> wrote:
>First off, you should look at the data caching feature in ND5 to
see if>that might do something for you.
>
>Anyhow, I've got some stuff that caches rows, on a session basis.
>Question: are you trying to cache data for use in one session or
across
>multiple sessions?
>
>If for one session, I would put the data into a session object. In
each
>page get the session object in onBeforeLoad or button/href web
events, put
>it back at the end of processing. I keep rows from up to 30 tables
in
>memory on this basis.
>
>At one point, I had a singleton class, and it killed performance.
I found
>that it worked to have one object of the class owned by each page
class,
>since much of ND's object instantiation model is driven at the page
level.
>
>You should also look at EJB in ND5. That would be a cleaner
implementation
>than anything available in ND4, except maybe a PAC.
>
>-- Curt Springer, Team ND
>
>At 04:08 PM 4/15/99 -0800, [EMAIL PROTECTED] wrote:
>>In our architecture, we have a Cache Manager component which
caches the
>data (in memory) to
>>reduce trips to the DB. Cache Manager is a singleton, i.e. there
is only
>one instance of Cache Manager.
>>What is the best way to implement the Cache Manager in ND so that
the
>cached data
>>is accessible to other services?
>>
>>Thanks...
>>
>>Raj
>>
>>_________________________________________________________________________
>>
>>For help in using, subscribing, and unsubscribing to the
discussion
>>forums, please go to:
http://www.netdynamics.com/support/visitdevfor.html
>>
>>For dire need help, email: [EMAIL PROTECTED]
>>
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to:
http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]