Win a copy of Microservices Testing (Live Project) this week in the Spring 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

How many Bean and EJBObject instances for 2 clients?

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am having a confusion regarding the number of Bean Bean and EJBObject instances will be there representing 1 entity for 2 clients. For example in Employee table, there is a row for Employee named e1. If 2 Entity Bean clients invokes findByPK on Employee Home targeting the same row e1. Now will there be 2 EJBObject instances for each client? Will there be 2 Employee bean instances representing the same entity e1? Please explain.
Thanks In Advance,
Phanindra
 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For entity beans, clients can share the same EJBObject and entity bean instance that reside on the server. Each client will, of course, have its own instance of the EJBObject stub for remote calls. For local calls, each client will have its own reference to the single EJBObject.
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you get one EJBObject per bean type. This probably does not mean that a physical EJBObject is created for each bean type; rather, think of each EJBObject as a logical object which the container may map to a single, physical EJBObject object. I find it helpful to think of the EJBObject in an abstract rather than in a physical way.
 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you're studying for the SCBCD, you should mainly pay attention to a conceptual reality rather than a physical one. The spec gives container vendors a lot of room to implement it as they see fit. For example, for a given entity bean, the container may have several actual instances of the EJBHome. But, conceptually, there is only one EJBHome for each entity bean type. So, if you get a question about how many homes there are for a bean type, answer "1" because this is the conceptually correct answer.
 
Phanindra Nayani
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I appreciate your help Guys.
 
reply
    Bookmark Topic Watch Topic
  • New Topic