Win a copy of AWS Security this week in the Cloud/Virtualization 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

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
roses are red, violets are blue. Some poems rhyme and some are a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic