aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Entity Bean Cache Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Entity Bean Cache" Watch "Entity Bean Cache" New topic
Author

Entity Bean Cache

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1368
What is 'Entity Bean Cache'?
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
Spec says that the container must maintain a pool of entity bean instances. However the containers chose to cache the entity beans as well, in order to improve server�s performances.


I think, therefore I exist -- Rene Descartes
James Du
Ranch Hand

Joined: Mar 23, 2001
Posts: 186
However the containers chose to cache the entity beans as well


Hi, Valentin

I am wondering what do you mean by chose to cache.... Since the pool is must, what do you think the container could use it otherway ?


regard,
James
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
Hi James,

The answer to your question is not very short, but I�ll do my best to make it short. A straight answer would be this: because the container implements a lot of feature that are beyond the J2EE specs: caching entity beans between transactions (and reducing the number of ejbLoad()/ejbStore() method calls), providing read-only EJBs, etc. Therefore the container will chose to implement a cache of entity beans as well. Please don�t understand me wrong: the container will not replace the free pool with an internal cache; this techniques are complementary not exclusive. However there is a big difference between the pool and the internal cache. The cache will contain only READY instances: they have identity (an associated primary key), but are not currently enlisted in a transaction. WebLogic maintains READY entity EJB instances in least-recently-used (LRU) order. If the bean gets enlisted in a transaction then the instance becomes ACTIVE and will return to cache after the transaction ends. As you can see there is a lot of stuff beyond the specs�
Regards.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Entity Bean Cache
 
Similar Threads
about difference and relationship between cache and instance pool
Entity Cache
Question on ejbload()
Question on ejbload()
'coarse-grained' interface to clients