• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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

 
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!
 
Cowgirl and Author
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!
 
a wee bit from the empire
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic