• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Need of EntityContext when bean in pooled state

Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For an entity bean, the container instantiates the Entitybean class and calls setEntityConext(entityContext) on it.

I would like to know what is the use of EntityContext variable for the entity bean instance when it is in pooled state.
Where actually the bean is using the entityContext in pooled state.

The same applies for a Session Bean also.
I understand that the entity bean with the help of EntityContext can know about its Home, environment.
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only use I can think of is to save it for future use, as it is too early to do any of the following *important* things:

1. Make a JDBC call, because transaction context is unavailable.
2. Invoke other beans, because security context is unavailable(Even though the bean is allowed to lookup another bean, it is not allowed to invoke any methods)

So save the EntityContext/SessionContext and wait until the container allows you to play with it
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic