• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need of EntityContext when bean in pooled state

 
Naslai Shobha
Greenhorn
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.
 
Keerthi P
Ranch Hand
Posts: 203
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic