Justin, Have you tried setting <cascade-delete/> on BeanB? If you haven't, can you please try and tell us what happens.
Also, try 'beanA.remove()' as opposed to 'beanA.getBeanBs().clear()'. This works for me for '1:N relationships'. Thanks. >-- Original Message -- >Date: Mon, 20 Jan 2003 11:20:18 -0800 >Reply-To: Justin Wesbrooks <[EMAIL PROTECTED]> >From: Justin Wesbrooks <[EMAIL PROTECTED]> >Subject: Relationship deletion question >To: [EMAIL PROTECTED] > > >AppServer: WLS 7.0 > >I have 2 beans with a 1:N relationship. BeanA has a Collection >of BeanB. I try to call BeanA.getBeanBs().clear(). All items >are removed from the Collection, however, nothing is removed >from the underlying database. I have another situation similar to >this one and the exact same call works. I'll highlight the differences >in the 2 below. > >Working situation >===================== >True M:N relationship with CMP (as outlined in Ed Roman book). >String as primary key (no primary key class) >clear() removes all records from the association table. > >Non-working situation >===================== >1:N relationship >The collection class has compound PK class. >The collection class also has a M:1 relationship with another CMP bean. >(This is kind of like the "Fake M:N relationship described in the Ed Roman >book) > >Both of these calls are made in a Stateless Session bean. Can >someone point me to some literature on this or provide any insight?? > >=========================================================================== >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".
