Hi Louis "Leigh, Louis" wrote: > Hello, > > I am having trouble with an EJB problem. I want to use container managed > persistence and have two Entity beans, like a person bean and his address > bean both save to their persistent storage as a unit so the data integrity > between the two is preserved. Example. I can't have the address inserting > if the insert of the person failed. I'm assuming there is a way, maybe like > having a session bean with remote instances of both. If the session bean > closes do the two entity beans get saved as a unit and is there a backout > automatically handled by an application server that will keep the two > relational tables in sync. Do I need to manage this with the jta or can > Container managed persistence do it for me. My approach would be to use CMP or BMP for your person and address bean (depending on the complexity of your database schema) with TX_MANDATORY for your persistence logic and to use a (stateless) session bean dealing with the two entity beans for your business logic (TX_REQUIRED or TX_REWUIRED_NEW). Don't let your clients talk directly to your entity beans. Use the session bean and let it automatically handle the whole transaction management issues. You just have to take care your session bean knows about your database constraints. > > > =========================================================================== > 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". Cheers Manfred
begin:vcard n:Sturm;Manfred tel;fax:031 305 16 17 tel;work:031 305 16 19 x-mozilla-html:FALSE org:itServe AG version:2.1 email;internet:[EMAIL PROTECTED] title:Software Engineer adr;quoted-printable:;;L=E4nggass-Strasse 26=0D=0APostfach 690=0D=0A3000 Bern 9;;;; x-mozilla-cpt:;9744 fn:Manfred Sturm end:vcard
