The container should do an insert into the database after the ejbCreate() gets called. You can create children in the parent's ejbPostCreate() that's what it's for. Entity beans CANNOT use/access any transaction attributes. This is only reserved for session beans. Thus you cannot directly access a transaction. However, you could call a session bean which can do the job for you. In general, however, your specific problem does not require such measures.
-AP_ -----Original Message----- From: A mailing list for Enterprise JavaBeans development [mailto:[EMAIL PROTECTED]]On Behalf Of Hu Shih Sent: Friday, January 25, 2002 9:22 AM To: [EMAIL PROTECTED] Subject: Questions on EBs Experts: Can I get a hold of the current transaction inside an entity bean and commit it? Is it possible for BMP or CMP or both or neither? Is it different between BMP bean vs. CMP bean? Suppose I have two related entity beans, BA and BB, built on top of tables that have a primary/foreign key referential integrity. I create a new BB. Before this entity bean is stored to database, I need to make sure changes to the parent (BA) is stored. How do I cause ejbStore on BA from BB? Does home.create() on a CMP entity bean always insert a new row? The spec doesn't seem to require this, but all examples that I've seen do. This will perform badly for mass inserts. If it doesn't insert a new row, how do I control when it is inserted? Do I have any control over this? _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
