wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes The ejbPostCreate Method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "The ejbPostCreate Method " Watch "The ejbPostCreate Method " New topic
Author

The ejbPostCreate Method

Maria George
Greenhorn

Joined: Dec 25, 2006
Posts: 3
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 ]
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Nope.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

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.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: The ejbPostCreate Method