dcsimg
In memory only Entity EJBS
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Achilleus_Mantzios
Posted On:   Friday, December 21, 2001 01:07 AM

Hi, i wonder if this is possible: Imagine we want to have a "object" that is persistent only in main memory. Also it has an id. Consider having graphical charts that many people during the day access but there is no reason to make them stored in a databse. A solution would be an entity bean with finder methods that the clients use, but with dummy load/store methods. Unfortunately, after such a bean is created , when a finder method is called by a client, the container (jboss in my case) does not associate the activated instance with the one just created, but crea   More>>

Hi,
i wonder if this is possible:

Imagine we want to have a "object"
that is persistent only in main
memory.
Also it has an id.


Consider having graphical charts
that many people during the day
access but there is no reason
to make them stored in a databse.


A solution would be an entity bean
with finder methods that the clients
use, but with dummy load/store
methods.


Unfortunately, after such a bean is created
, when a finder method is called by a client,
the container (jboss in my case)
does not associate the activated instance
with the one just created, but
creates a new instance, and then
tries to activate and load,
meaning that the variables populated
during create are now lost.


The other method i can think of,
is using session beans,
but then again, instead of using
the finder methods we would
now store and retrieve the handle
of the remote object, which sounds
not so good.


Any ideas would be really nice :)

   <<Less

Re: In memory only Entity EJBS

Posted By:   Bozidar_Dangubic  
Posted On:   Friday, December 21, 2001 05:38 AM

do not use EJBs for this. EJBs are about the worst solution to this problem. create the object you want people to use and cache it with global access. you can bind into the JNDI or use ServletContext if servlets/JSPs are involved. but do not use EJBs since this is really no fit for them. I mean you could do it with EJBs but it very confusing and maintenance of your application will be very difficult since everybody associates entity beans with database data, most of the time a single row in the database. your "in-memory" graphical chart is not a fit for EJBs so do not use EJBs for this purpose. there are no advantages and many disadvantages to using entity beans in cache in-memory objects.
About | Sitemap | Contact