Hi Gowda
Remember ejbActivate() is called after the container avtivates the bean instance so container has already assigned the EJBObject & primarykey to the bean instance before calling this method.
See
ejb specification 2.0 page 171
--------------------------------------------------------------------------
public void ejbActivate();
The container invokes this method on the instance when the container picks the instance from
the pool and assigns it to a specific entity object identity. The ejbActivate() method gives
the entity bean instance the chance to acquire additional resources that it needs while it is in the
ready state.
This method executes with an unspecified transaction context. The entity bean must not
attempt to access its persistent state or relationships using the accessor methods during this
method.
The instance can obtain the identity of the entity object via the getPrimaryKey(), getEJBLocalObject(),
or getEJBObject() method on the entity context. The instance
can rely on the fact that the primary key and entity object identity will remain associated with
the instance until the completion of ejbPassivate() or ejbRemove().