Hi Andreas, we do caching this way, therefore having a single cache per JVM (our app is running in a farm of 5 Web/App servers--Orion).
It's great for read-only operations; some servers (Orion is one of them) do this caching for you, granted you give a single instance of the server EXCLUSIVE write access to the DB; therefore, we implemented our own, read-only, in-memory caching gear. If you use VO's, the problem is trivial -- as long as the cache is for read-only data.
 
HTH,
 
JP
 
PS: BTW, the app powers a web site with 10 M hits/week, so I guess we could call it a "real-life application"... ;-)
-----Original Message-----
From: Andreas Maschke [mailto:[EMAIL PROTECTED]]
Sent: Martes, 14 de Agosto de 2001 15:16
To: [EMAIL PROTECTED]
Subject: Weird Caching Questions

Hi Dear All,
 
being a newbee to EJB I hope the following questions don't bother you: :-)

I have a static class XYZData with a static Vector containing some data. The Vector acts like a cache. If I request some record from the class,
it first searches the Vector. If there is no matching record it is loaded from the Database and appended to the list.
Now I have a stateless session bean which imports this class. There is a method which calls the static method of the class XYZData to request records.

The questions are:
How many instances of the class XYZData (and the cached data) are created by an Application Server if it creates multiple instances
of the session bean? 
Is this a valid design to implement a (read-only) cache in EJB? Are there better ways? (Using "read-only entity beans" seems to be very vendor-specific.)

I read so many docs - but a real answer to caching I never found. But I can't imagine a "real-life application" without extensive caching.
In our application we have country data, currency data, configuration data, language data... lots of data which may be configured by the end user.
But after beeing configurated this data remains unchanged for months.

What's the answer to this type of problem? I'm very frustated about this. There is so much effort and rumor about CMP. But in my opinion CMP (at this time) doesn't help you to actually solve problems. No doubt, is has many advantages and is a fine idea - but complex problems become not really easier. (Foreign key relations appear to be a pain, there is one more query language, performance is also a problem, ...)
In comparison caching of data appears to be a very trivial problem. But I don't see any  c l e a n  way to implement it.
Please help!

Thank you much,
Andreas Maschke

For your protection, this e-mail message has been scanned for Viruses.

Visit us at http://www.neoris.com/


Reply via email to