Making a read-only entity bean is pretty trivial in bean-managed
persistence; just
don't implement ejbStore(). Since you only want it to load once, you could
set a
flag to let yourself know not to reload it when ejbLoad() is invoked. On the
other
hand, if the underlying data can change during the user interaction, and
if this change matters (i.e. if the data will be used to drive further
transactions,
as opposed to a simple display of trivial data (but then, if the data is
meaningless,
why display it at all?)), you'd probably want to let ejbLoad() reload it as
needed.
(That may be the worst sentence ever written in the English language, but
I'm
too tired to come up with anything better right now. :-) )
For container-managed persistence, you'll need to consult the docs for your
particular
implementation.
I don't understand why you want to make it time out after a certain period
of time. Why
worry about this? Just let the app server handle the lifecycle and be
confident that it'll
be there when you need it.
===========================================================================
Tom Valesky -- [EMAIL PROTECTED]
http://www.patriot.net/users/tvalesky
----- Original Message -----
From: "Atul Tiwary" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 19, 2001 3:35 PM
Subject: Read only entity beans
> I'm trying to implement a a read only entity bean for caching some
> static data. I just want to load this data when the bean is first
> invoked and then keep the bean active for a particular period of time.
>
> If no accesses are made to the read only entity bean. Then I want to
> time it out.
>
> Could someone point me to an example (an EJB pattern perhaps) that I could
> read up or better still
> provide an explaination on how I could go about designing something like
> this.
>
> Thanks,
> Atul
>
>
===========================================================================
> 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".