• Post Reply Bookmark Topic Watch Topic
  • New Topic

entity bean finder methods - what happens exactly?  RSS feed

Blake Xiao
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When a client calls one of the finder methods on an entity bean's ejbhome, does the container 1) always create a new Ejbobject and return it to the client or 2) try to find if there is already an ejbobject with the same primary key and if so return the said ejbobject?
For example, if a client calls the findByPrimaryKey on an entity bean home three times in a row, does the client get three different EJBObjects or references to the same EJBObject ?
The implication of this question is that if 1) is true, then at any time there may be multiple EJBObject/Bean instances that are dealing with the same record in the underlying database. Since when/how frequently ejbLoad() and ejbStore() get called is up to the container, this may or may not be a problem. For example, if ejbLoad() is called every time a business method is invoked, this may not be a problem. Otherwise...
Anyone can help clarify this?
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!