Basically, for a cache you need a singleton, right? No such animal
in EJB, "if you work according to the spec".
The
best you can do in order to have a cache in the distributed environment, is
to have a copy of the cache on each of the app server machines, as they
supposed to be "equivivalent", i.e. there is no telling which machine will be
handling a call from a new user, unless you use statefull EJB, which are,
as you said, tied to a particular user: user B can not use user A's cache
(not good).
However, you CAN use DB as a cache, and DB is shared among all the beans,
so it can act as your singleton in the EJB environment. If so, would
use a Session Bean to act as a DAO.
Alternatively, you may want to check out the automatic caching products
that work with the EJB servers, like Javlin and TopLink, but I personaly never
used them.
Greg
--------Original Message-----
From: Kamyar Varzandeh [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 5:14 PM
To: jdjlist
Subject: [jdjlist] EJBs as a Remote object Cache ServerHi:We are trying to develop a remote cache server. Our goals is to reduce memory consumption (and GC cycles) in our app server and share the common read-only data across multiple servers. .We have experimented with RMI and EJB-based solutions. The RMI solution seems to work. However, we are running into trouble with the EJB solution. We are using Websphere 4.0. for the EJB-based approachFirst we tried to use a stateful session bean, but soon we discovered that it would only work for a given client, not as a general purpose cache. Now we are trying to use entity beans, but the container does not give us the same bean instance. It creates a new bean instance which defeats the purpose of using the bean as a cache server. We are passing the reference to the bean between different clients using the EJBHandle serialized in LDAP (not calling EJBCreate or EJBFind).Do we have a chance of making the EJB solution work, or should we drop this approach and stay with the RMI solution?Thanks in advance for the help.Kamyar
Do you Yahoo!?
Free online calendar with sync to Outlook(TM). --- You are currently subscribed to jdjlist as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] http://www.sys-con.com/fusetalk
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
http://www.sys-con.com/fusetalk
