• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

EJB Table, please correct me and contribute

 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I've come out with a table as follows.
Please feel free to give your comment and correct any mistake I've made or anything you think it is useful to add.
I know cross posting is not allow, so, hopefully the guys visiting EJB forum can pop in to have a look too.
Cheers.

Han Ming
<table border="1" width="100%">
<tr>
<td width="25%">Methods</td>
<td width="25%">Entity Bean (CMP)</td>
<td width="25%">Entity Bean (BMP)</td>
<td width="25%">Stateless Session Bean</td>
<td width="25%">Stateful Session Bean</td>
</tr>
<tr>
<td width="25%">Initial state </td>
<td width="25%">create by AppServer and put into pool</td>
<td width="25%">create by AppServer and put into pool</td>
<td width="25%">create by AppServer and put into pool</td>
<td width="25%">create by AppServer and put into pool</td>
</tr>
<tr>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
<tr>
<td width="25%">create</td>
<td width="25%">call ejbCreate in Bean class</td>
<td width="25%">call ejbCreate in Bean class</td>
<td width="25%">Does not call ejbCreate in Bean class
<p>only create an EJBObject for the client</p>
</td>
<td width="25%">call ejbCreate in Bean class</td>
</tr>
<tr>
<td width="25%">ejbCreate</td>
<td width="25%">before insertion</td>
<td width="25%">on insertion</td>
<td width="25%">creation of each bean
<p>called only once when create by EJB Container</p>
</td>
<td width="25%">creation of each bean</td>
</tr>
<tr>
<td width="25%">ejbPostCreate</td>
<td width="25%">after insertion</td>
<td width="25%">after insertion</td>
<td width="25%">NA</td>
<td width="25%">NA</td>
</tr>
<tr>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
<tr>
<td width="25%">remove</td>
<td width="25%">call ejbRemove</td>
<td width="25%">call ejbRemvoe</td>
<td width="25%">bean instance is put back to pool</td>
<td width="25%">call ejbRemove</td>
</tr>
<tr>
<td width="25%">ejbRemove</td>
<td width="25%">before deletion of record</td>
<td width="25%">on deletion of record</td>
<td width="25%">before bean is remove from memory</td>
<td width="25%">before bean is remove from memory</td>
</tr>
<tr>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
<tr>
<td width="25%">ejbActivate</td>
<td width="25%">after the Bean is activated</td>
<td width="25%">on Bean is activated</td>
<td width="25%">never called</td>
<td width="25%">after Bean is activated</td>
</tr>
<tr>
<td width="25%">ejbPassivate</td>
<td width="25%">before Bean is passivated and instance put back to pool</td>
<td width="25%">on Bean is passivated and instance put back to pool</td>
<td width="25%">never called</td>
<td width="25%">before Bean is passivated and instance destroyed after
passivation</td>
</tr>
<tr>
<td width="25%">passivation</td>
<td width="25%">only null, java primitive, serializable,  EJBHome,
EJBObject, EJBLocalHome, EJBLocalObject, UserTransaction, JNDI ENC,
SessionContext, resource factories will be preserved in conversational
state.<br>
But primitive will be restore to default values.</td>
<td width="25%">as Entity CMP</td>
<td width="25%">As they are never passivate, resource connection e.g.JDBC,
socket can remain open throughout their life</td>
<td width="25%">as Entity CMP</td>
</tr>
<tr>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
<tr>
<td width="25%">ejbLoad</td>
<td width="25%">after bean is loaded</td>
<td width="25%">on bean is being loaded</td>
<td width="25%">NA</td>
<td width="25%">NA</td>
</tr>
<tr>
<td width="25%">ejbStore</td>
<td width="25%">before bean is stored</td>
<td width="25%">on bean is being stored</td>
<td width="25%">NA</td>
<td width="25%">NA</td>
</tr>
<tr>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
<tr>
<td width="25%">setEntityContext</td>
<td width="25%">when bean is created in pooled by EJB Container</td>
<td width="25%">when bean is created in pooled by EJB Container</td>
<td width="25%">NA</td>
<td width="25%">NA</td>
</tr>
<tr>
<td width="25%">unsetEntityContext</td>
<td width="25%">before bean is remove from memory</td>
<td width="25%">before bean is remove from memory</td>
<td width="25%">NA</td>
<td width="25%">NA</td>
</tr>
<tr>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
<tr>
<td width="25%">setSessionContext</td>
<td width="25%">when created by EJB Container</td>
<td width="25%">when created by EJB Container</td>
<td width="25%">called once when created by EJB Container</td>
<td width="25%">when create is called by client</td>
</tr>
</table>
 
HanMing Low
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops,
It turns out to be very ugly.
I'd appreciate if the moderator convert it to a table as in the html tag.
Sorry.
 
That's my roommate. He's kinda weird, but he always pays his half of the rent. And he gave me this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!