Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

entity bean finder methods - what happens exactly?

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?
    Bookmark Topic Watch Topic
  • New Topic