-
1. Re: sharing data between multiple instances of a session bea
damo9f May 27, 2004 6:10 PM (in response to vjha)I think you can squirrel the data away in JNDI.
A more interesting question to me is that if you want fast access to per-JVM caches, can you somehow synchronize access to static data without deadlocking the system?
It seems you've got to be able to do that, because 3rd party persistence products will need to use caches such as an Object-Identity cache and there should therefore be a way to use a cache and still work inside J2EE. -
2. Re: sharing data between multiple instances of a session bea
adrian.brock May 27, 2004 6:22 PM (in response to vjha)Your question is
"I want Stateful behaviour but with Stateless beans".
You are haven't got a prayer.
You can use singletons in your stateless beans
private static final MyCache cache = MyCache.getSingleton();
but ...
1) you are still breaking the spec if you hold state based upon the client
2) doesn't work unless like your in example the data can be lost (e.g. a clustered environment)
3) usually causes memory leaks