Stateless Sessions beans sound like a good idea. How about creating a read
only Cache as a static Singleton. When your EJB clients want to lookup data
stored in the cache they could call a Stateless Session bean with the key as
a method parameter. The static Singleton cache should not be subject to
timeouts.
I'm thinking:
1. Start EJB server
2. Start webserver/servlet engine
2a. An EJB startup servlet calls the EJB server and forces the load of read
only data in the cache
I'm not sure how you tell clients NOT to call the EJB server until the cache
is loaded but... Also, you will probably need a way to force flush/reload of
specific cached objects if their underlying values are changed in a
database.
Any reasons why this is not workable in an EJB/servlet architecture? I'm not
convinced that Entity beans are appropriate in this situation.
Regards,
Mikef
> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Ingo Schuster
> Sent: Monday, January 17, 2000 9:36 AM
> To: [EMAIL PROTECTED]
> Subject: Caching of read-only DB contents in an EJB
>
>
> Hi everybody,
>
> I'm currently working on my diploma thesis "Application
> Architectures with the
> J2EE". One of the issues I want to work on is about database caching. A
> question I'm currently facing is the following:
>
> For performance issues, one could try to cache records of a
> read-only database
> in an EJB. However, this might raise some new problems, some questions at
> least:
>
> 1. What type of EJB is is best suited for this job: Entity or
> Stateless Session
> (Stateful Session doesn't make sense, I think)?
> 2. If I choose a stateless session bean:
> - Will I get trouble with timeouts (the container removes the
> bean and I
> have to "save the cache")?
> - The container could create several intances of this session
> bean or can I
> make sure that only a certain number is instantiated?
> 3. Is there an alternative to using EJBs - e.g. servlets ? But in
> that case my
> application would needed be accessed through the webtier - a stand-alone
> application accessing the EJB tier directly couldn't use the
> caching, right?
>
> If anybody has some ideas about this questions, I would be
> grateful for some
> help!
>
> ingo.
>
> ==================================================================
> =========
> 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".