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.
posted 12 years ago
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
SCJP, SCWCD, SCBCD
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads