If you can imagine one to many relationship like One Customer can place multiple Orders (1..*)then you can understand that record in customer is a must to have a record(s) in order table right?
In ejbCreate() you(BMP....say container in case of CMP) can insert a row in Customer if this is successful then ejbPostCreate() will be called (where you cam do a data insertion in Order table)ensuring data integrity.
Obviously this is one of the use....One important thing to remember is Primary Key is avaialble in ejbPostCreate() & not in ejbCreate()method I hope this helps
Another difference, as you start mucking around with performance tuning options in a container, is that you'll find the database activities that correspond to ejbCreate and ejbPostCreate will shift around. Sometimes you can improve performance sometimes by delaying commits until after the post-create, but typically at a cost of a simple create exception instead of a duplicate key exception when you try to insert an already-used PK. [ March 13, 2006: Message edited by: Reid M. Pinchback ]
Reid - SCJP2 (April 2002)
These are the worst of times and these are the best of times. And this is the best tiny ad: