I think the answer is A.
Obviously, B is incorrect because the Entity Bean does not contain a create() method, since this is defined in the home interface, and when it is implemented in the bean, the
ejb prefix will be added.
D is incorrect because the DB is complaining about the primary key violation. It will be correct, if the error is solely about saving the bean data, without any key issues.
In fact, choice A and C are quite similar, however, ejbPostCreate() is used to finish any actions that cannot be performed in ejbCreate() as the bean is not completely created at that moment. However, upon ejbCreate() is completed, the bean is created and the data is appear in the DB. Thus, if a data item cannot be inserted into the DB due to PK violation, problems should be appeared in ejbCreate().
Does this make sense?
Nick
SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)