Hi all,

I have a problem with RemovalAwareCollection - or rather, the fact that
it is the default internal Collection class for PB queries.

I have a Class A which has a Collection of class Bs. Also there may be
other classes (say C, D, E) which could reference the same B - so there
are a number of m:n relations. Now, if I get the Collection of Bs from
A, and then delete from it a single B, *the B itself is deleted in the
database*. This is because of the default RemovalAwareCollection that is
returned to me when I call the 'getBs()' method on A.

This is a big problem because I only want to remove the *relation*
between A and B - however because of the RemovalAwareCollection, B no
longer exists and so C, D and E cannot use it anymore. The B should only
be removed from the DB *if there were no other references to it*.

I know that I can specify eg ManageableArrayList in my repository file
to get over the problem, but I think that assuming a default of DB
deletion for Collection objects is a bad idea, especially since this
will cause problems for applications like mine where there are multiple
other references to a Collection object, or if the Collection object is
in fact independent. Also this behaviour is different to previous
versions of OJB (we used 0.9.7 before) - it worked the way we wanted
before but now it doesn't. Is the default behaviour likely to be
changed?

Cheers,

Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to