Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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

Findermethod in Entitybean

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I understand a entitybean is not even supposed to leave the pool during a finderMethod (findByPrimaryKey). It should just make sure the entity exists and return the reference to the EJBObject to the client.
But when I try this (in Weblogic) and make logging output in the callback method it shows that it will do a lot more.
This is the result from a single findByPrimaryKey:
contructor()
setEntityContext()
ejbActivate()
ejbLoad()
It seems like it gets out of the pool and even loaded during the finder method. How should I think in this case where it seems to be a huge diffrence between theory and practice?
/Best
Magnus
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The finder method is called on a bean that is in the pool. It does not mean that that particular bean is "found". So when the client get a reference to the "found" bean, the found bean must be in the ready state.
The bean instance on which the finder was called could be potentially different from the one that was found.
 
Magnus Stattin
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your answer Bob.
The bean that is performing the findermethod should not leave the pool and I don't think it does. But the beans that is found should also stay in the pool (according to HF EJB page 343) until the business methods are called upon them. When I try this they do not, they get activated and loaded even without business calls.
Is this in anyway container specific, or why do they get loaded when the risk becoming stale before they get the business calls?
/Magnus
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I still have doubt on it....
in addition to your discussion on entity beans and their finder methods, the things which happens is this.....
you call ejbFindBySomething() on home;
the container calls ejbFindBySomething() and then whether it finds a proper entity for it or not it calls ejbActivate(), ejbLoad(), ejbStore() and ejbPassivate().
So what happens is the bean comes out of the pool and gets back to the pool. Because as u were discussing and as mentioned in Spec and HF EJB, that a bean comes out of the pool if the ejbActivate() is called so does not matters which container calls it whether BEA or IBM if it goes by specification it is making the bean come out of the pool.
So my question still lies there on the table ... why? is it so??
Sudeep
 
Space pants. Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic