Read-write static fields are explicitly prohibited by the spec (sec 18.1.2
of the draft 1.1 spec).
The most EJB-friendly way to do what you want would be to make your cache an
entity
bean, and hold references to it in your session bean. That way,
1) Your data will be shared.
2) Your data will also be persisted, transactional, etc.
3) You won't have to resort to odd tricks to get around the problem. (i.e.
the maintenance
programmers who work on your system 10 years from now will understand it).

That's what I'd do. I don't know of a fallback position. Anyone else?

===========================================================================
  Tom Valesky   -- [EMAIL PROTECTED]
       http://www.patriot.net/users/tvalesky

-----Original Message-----
From: David Michaels <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Friday, June 18, 1999 10:03 PM
Subject: sharing data between instances of same session bean?


>I want to share data between all session beans deployed in the same
>container. This shared data is a cache of the results of previous
>requests to any of the session bean's instances, so it must be fast.
>
>Is there any prohibition against accessing static fields in your bean?
>Or against doing my own synchronization against these fields?
>
>
>--
>David Michaels <[EMAIL PROTECTED]>
>Director of Technology
>ShockMarket Corporation (650) 330-4665

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to