imagine the following example relationship:
item-lineitem-order

a line item has a relationship with item. when you delete a line item, you
would not want to delete its corresponding item but you would want the
relationship( that once existed between the lineitem that was removed and
the item to be removed) to cease existing. (your option 1)

an order has relationship with line items. when you delete an order its
lineitems do not have a meaning, they only exist within the scope of their
order. so when you delete the order, you would want the line items to be
delete to - this is cascade delete (your option 2).

hope this helps.



-----Original Message-----
From: D K [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 20, 2004 9:34 AM
To: [EMAIL PROTECTED]
Subject: Entity Bean's remove() method


Hi,

When we invoke a remove method on entity bean - that has some relationship
with other entity beans, mentioned in deployment descriptor - I understand
the following will occur:

(1) The container will remove Entity Bean from all relationship in which it
participates

(2) The persistent representation of the Entity Bean will be removed

In Section "10.3.4.1" of ejb specification, besides the above, the following
is mentioned:

"After removing the entity object from all relationships and removing its
persistent representation, the container must then cascade the removal to
all entity beans with which the entity had been previously in
container-managed relationships for which the cascade-delete option was
specified."


What is the difference between the relationships that are deleted here and
the relationships get deleted in step (2) - can someone clarify?

-KD

_____________________________________________________________
Free, simple, fast, memorable email
Become [EMAIL PROTECTED] at http://www.emailaccount.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".

Reply via email to