• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Entity Bean Cache

 
kri shan
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is 'Entity Bean Cache'?
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
James Du
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic