I am going through the sun J2EE tutorials...I have some doubts on entity bean example: http://java.sun.com/j2ee/1.4/docs/tutorial/doc/ It says: For each ejbCreate method, you must write an ejbPostCreate method in the entity bean class. The EJB container invokes ejbPostCreate immediately after it calls ejbCreate. My question is can we allow a client to invoke this method (indirectly ofcourse) by defining postCreate method in the home interface.. [ December 25, 2006: Message edited by: Maria George ]
No that is not allowed. You have a postCreate() to tell the bean that an EJBObject is now available for use. You create the primary key in ejbCreate() and by the time its postCreate() the bean has full beaness and can even enter into a transaction.