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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Entity Context - how it finds its bean's primary keys?

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really need your help... May be my question is Junk... but, please try to spend some time on this.
I was trying to understand how entity context is implemented by the container. it has methods to fetch the primary key related to the bean instance... but, i was wondering how does it know to which bean instance it is currently related to. so, when ever a bean is swapped out and swapped in with different DB Data how come context retrieves the correct primary key?

Any Idea ....
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi raghavendra ,
Whenever the container creates the bean instances it gives it a EntityContext and places the bean in the pool.

After say user calls the create on the home interface the container will pull the bean from the pool call the ejbCreate and then will insert the record in the database. After the record has been inserted the container will create a EJBObject for the same and updates the EntityContext with the new primary key . The EJBObject created will be returned back to the client.

hope that helps
[ April 20, 2005: Message edited by: sawan parihar ]
It sure was nice of your sister to lend us her car. Let's show our appreciation by sharing this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic