Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How many Entity Beans required

 
Yog Ananth
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to insert 1000 records in a transaction so how many entity beans is required, can i do this for a single entity, it causes performance issue.
 
Daniel Rhoades
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on the server vendor could be one or many, entity beans can be pooled like session beans.
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Yog,

I want to insert 1000 records in a transaction so how many entity beans is required, can i do this for a single entity, it causes performance issue.

Weblogic for example pools entity ejbs and caches them at the same time. There is however a difference between bean instances in the pool and those cached: unlike pooled instances, the beans in the cache are associated with a client. Of course there is more than that, but I'll consider only this one for now. Beans in the cache could be either in an ACTIVE or READY state. Ready bean are eligible for passivation/activation at any time, using either an LRU or NRU algorithm. Those active are enlisted in a transaction and could not be passivated. Concluding I�ll tell you that in your case if you create 1000 beans within the same transaction, then I have reasons to believe that your container will create exactly 1000 bean instances. Of course different container vendors might have different strategies, but I�d rather expect a behavior similar to the one that Weblogic provides than otherwise. Usually capacity planning and early application profiling could avoid or identify this kind of problems.
Regards.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic