db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Waibel <ar...@code-au-lait.de>
Subject Re: [Bug?] PBImpl delete of 1:n relation when auto-delete is set true
Date Sat, 06 Dec 2003 21:37:44 GMT
Hi Thomas,

Thomas Mahler wrote:

>> 1. auto-retrieve is set true and we query a Product, then we get all 
>> Components from Product and remove some components (or set components 
>> 'null'). After this we delete this Product instance ---> auto-delete 
>> is true, thus all found components will be deleted (without the 
>> removed) BUT we should delete all components associated with this 
>> Product instance.
> 
> 
> Mhh. The original semantics of auto-delete=true was to delete all items 
> that are contained in the collection. why should the PB delete instances 
> that are not in the collection anymore?
> 
Problem is when foreign key constraints defined in the DB.

>> 2. auto-retrieve is set false. Get a Product and delete it. Since we 
>> set auto-delete true we expect that all associated Components will be 
>> deleted too.
>>
> 
> This will also not work for the same reason.
> 
> I see where you are coming from. You want to have the same semantics as 
> with a database based cascading delete.
> 
yep, that was my interpretation of auto-delete (my misinterpretation;-)).

> I don't think the OJB behaviour is buggy. It simply works as designed.
now its clear!

> (I fear I'm sounding like Bill Gates now ;-))
If OJB will run on 75% of all PC in future it's ok to sound like Bill ;-)

> Maybe we should clearly state that auto-delete="true" is not equivalent 
> with a cascing delete in the database?
yes, please a clear explanation of all auto-xy attributes in the docs.

regards,
Armin

> 
> have a nice weekend,
> Thomas
> 
>> Or do I misinterpret the 'auto-delete' flag?
>>
>> regards,
>> Armin
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message