Sharing Data in stateless session bean

Hi all:

I 'm using brokat advanced server

which supports only stateless session beans

I want to share some data between ejbs that i've wrote

is there a way.

i've tried putting the data in a java bean with a session scope and i passed the data with every ejb call.

but what if i want to modify the shared data.

is there a way to stored shared data on ejb servers

[422 byte] By [gasser] at [2007-9-26 4:37:27]
# 1

What I would investigate is writing a cache. This cache would be ordinary Java class(es) that would be accessed via a stateless bean (SLSB). Your other beans could use JNDI to look up the SLSB that proxies for the cache and access the data in this fashion. Since Gemstone doesn't give you too much for this, you may need to invent a locking mechanism for the cache to effectively synchronize the write methods. There are alot of strategies for this, you could use a member boolean flag variable that is set while the cache is being modified and unset afterwards. If attempts are made to modify the cache while the flag is set the caller can be made to block or an exception can be thrown, etc.

swatdba at 2007-6-29 17:56:21 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...