| Author |
EJB Context
|
Edy Yu
Ranch Hand
Joined: Nov 21, 2000
Posts: 264
|
|
|
Will each EJB instance have its own EJB context object?
|
<i><br />Sun Certified Programmer for Java 2 Platform (SCJP)<br />Sun Certified Developer for Java 2 Platform (SCJD)<br />Sun Certified Web Component Developer for Java2 Platform, Enterprise Edition (SCWCD)<br />Sun Certified Business Component Developer for Java2 Platform, Enterprise Edition (SCBCD)<br />Sun Certified Enterprise Architect for J2EE (SCEA)<br />IBM Certified Enterprise Developer, WebSphere Studio V5.0<br /></i>
|
 |
Hung Tang
Ranch Hand
Joined: Feb 14, 2002
Posts: 148
|
|
|
yes
|
 |
Avi Abrami
Ranch Hand
Joined: Oct 11, 2000
Posts: 1112
|
|
Hi Edy, An EJB consists of three classes: home interfaceremote interfacebean implementation If your bean is a session bean, then it must implement the SessionBean interface. This interface has the "setSessionContext()" method. Likewise, if your bean is an entity bean, it must implement the EntityBean interface. This interface has the "setEntityContext()" method. Since you are providing the implementation for these interfaces, you can do what you want. You may choose to provide empty implementations for these methods. In that case, your beans will _not_ have their own EJB context object (assuming I am correctly interpreting your question :-) So, in my opinion, the answer to your question is a resounding, "it depends". (Which is probably the most common answer to questions like yours ;-) Hope this has helped you. Good Luck, Avi. [ June 01, 2003: Message edited by: Avi Abrami ]
|
 |
 |
|
|
subject: EJB Context
|
|
|