Hi Prat,
Take a look at the methods of javax.ejb.SessionContext or javax.ejb.EntityContext. In both cases they have a getEJBObject() method that obtains a reference to the
EJB Object currently associated with the instance.
From the API:
An instance can use this method, for example, when it wants to pass a reference to itself in a method argument or result.
The EJBObject has a getHandle() method which can be used to persist the reference to the EJBObject. Sorry for sending you on the wrong path before.
It is a bad idea to use the "this" variable within EJBs - the instance of the bean associated to your Entity or Session object could change.
Are you studying for the SCBCD exam? If so, how close are you to going for the exam?
Regards, Andrew