Of course, you could also do it as a singleton or as a CMP instance (minimal
instances in
pool: 1 maximal instances: 1). Only reason for recreation would be if it can't
communicate with
it at any time.
Rickard �berg <[EMAIL PROTECTED]>
01/18/2000 11:08 AM GMT
Please respond to A mailing list for Enterprise JavaBeans development
<[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: (bcc: Matthew T. Machczynski)
Subject: Re: Caching of read-only DB contents in an EJB
Hi!
"Lahooti, Hamid" wrote:
> >>Almost but not quite. Readonly data can be cached by stateless session
> >>beans. If you need read/write caching then either use Entities or a RMI
> >>object.
>
> A stateless session bean with a state?
Yes. If it's readonly and not client specific. Sure.
> as a singleton?
I didn't say that.
> and it
> doesn't get destroyed by the container?
The state may be kept in instance variables of each stateless session
bean instance, or if you want to optimize it you could store it in
static variables and use lazy loading (i.e. check on each usage that the
class has not been reset, in which case you load the data again).
/Rickard
--
Rickard �berg
@home: +46 13 177937
Email: [EMAIL PROTECTED]
http://www.dreambean.com
Question reality
===========================================================================
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".
===========================================================================
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".