Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Home Business methods : bean doesn't come out of pool

 
Sekhar Kadiyala
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HF states that bean doesn't come out of the pool during the execution of the home business method. This is litttle confusing for me.

What kind of powers does the bean has when it is in the pool? I understand that it needs to be activated if we want to call any business methods thru EJB object. But how Home object can make it work from the pool itself!?

Can someone pls clarify, may be i am missing something!

Thanks in advance!
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy -- think of an entity bean instance as being able to wear two different hats:

1) I'm an actual ENTITY, representing a unique entity from the underlying persistent store.
(for example, "Fred Smith, PK #42)

OR

2) I'm a representative of the Customer Bean type, and I don't represent any particular customer "entity", but can act on behalf of ALL Customer beans.

When the bean is wearing hat #1, it must come out of the pool and become a fully-realized entity -- in other words, it is loaded with the data for one particular entity in the underlying store.

But when the bean is wearing hat #2, it does NOT get loaded with any particular customer entity data, so it can just stay in the pool without being activated and loaded. It just does its work from the pool, and it can do things like execute Finders and Home business methods.

Because it doesn't make sense to require that SOME actual entity perform a query for other entities, or to perform something like a batch operation on the database.

This is a good question to ask

Cheers,
Kathy
 
Sekhar Kadiyala
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kathy,
Thank you for the quick reply!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic