is this follwoing statement correct? why? In ejbActivate() method Bean Provider cannot use set accessor methods for abstract persistence schema to initialize the container-managed relationship or persistent fields.
what is the ejbActivate in cmp entity bean should have. when the bean goes to method ready state throgh ejbCreate, ejbPostCreate, i know that in ejbPostCreate we alloate the cmr fields values and in ejbCreate we set the cmpfields primary key.
so, in same way when bean goes from pooled state to method ready throgh ejbActivate, does the container load the cmp, cmr fields. does that mean my ejbActivate will be empty.
in ejbActivate and ejbPassivate there is no transaction contect,secury context. But it will be able to access the primary key,getEJBLocalObject() and getEJBObject().As it is not having the transaction context and security context it will not be able to acess other beans or resource managers.So i think acessing relational filds will be a problem
Yes, ejbActivate and ejbPassivate do not run in a meaninful transactional context. Therefore you cannot access database or entity fields or relational fields. And you don't have to worry about restoring the bean's cmp and cmr fields - container does it for you.
Ususally ejbActivate and ejbPassivate methods are empty, they are not very useful for anything (very rarely).
Yes,We no need to worry about restoring the database fileds when container called ejbActive(). When the ejbActivate() method calls, the ejbLoad() method calls implicitly to store the database fileds with the help of the primaryKey. The primerykey can get it from the EntityContext object. The container perform this job for us. If it is BMP, we need to write the code to restore the Database Fields.