To restate the question:
At what point, precisely, in the life-cycle is a container-managed entity bean considered created?
I would agree with Sun's answer that the bean is "created" immediately after the execution of its ejbCreate() method. Bean creation and transaction isolation are two separate issues. Even if the container has not committed the bean to the datastore, it is still considered "created" because you have a new instance of a Primary Key object for that entity.
Synchonization of the
EJB and the database is the container's responsibility. Given your assumptions I would answer yes to the interjected question.
1)transcation start
2)create EntityA -- call ejbCreate() of EntityA
2a) Do I have a "created" bean?
3)create EntityB -- call ejbCreate() of EntityB
3a) exception, ejbCreate never finished (no bean created)
4)commit or rollback
Comments?
[ January 07, 2003: Message edited by: Jack Coleman ]