Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
raghavendra dutt
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,
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 ....
 
sawan parihar
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic