• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why need setEntityContext in Entity Bean???

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
can any one give a little bit discription about
Why we need a setEntityContext() in Entity bean because it is independent of state?
Bidyut
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
setEntityContext is the first method called after a bean instance is created.
It set the EntityContext of the bean
It provides information about the client that is using the bean. Alongwith providing this it also provides the instance with acccess to its own EJB home and EJB object.
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bidyut,
Entity beans represent persistent data from a data store and therefore when activated, they do have state. The state being the data that they represent. But state really has nothing to do with EntityContext. Through the EntityContext the bean can gain knowledge of; the EJB Object that it is associated with, it's Primary Key and it's environment.
Amanda
 
Bidyut Padhi
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks
Amanda
I got the answer .
regards
Bidyut
reply
    Bookmark Topic Watch Topic
  • New Topic