Re: Cascade delete with optional to-one relationship
Re: Cascade delete with optional to-one relationship
- Subject: Re: Cascade delete with optional to-one relationship
- From: Chuck Hill <email@hidden>
- Date: Mon, 20 Oct 2003 15:40:24 -0700
That means you have a referential integrity problem in your database. You
have an A object related to a B object (with a PK of 2) that does not
exist. Fix your bad data and this will go away.
Chuck
At 05:08 PM 20/10/2003 -0500, Albert Jagnow wrote:
>It is possible to use cascade delete on an optional to-one relationship.
>For example I have table A and table B where table A has an optional
>to-one relationship to table B. Most of the time table A will have no
>table B object, but if table A does have a relationship to table B and
>the table A object is deleted I want the table B object deleted as well.
>I assume I would set the relationship to optional and the delete rule to
>cascade in EOModeler to accomplish this. However if I do this and I try
>to delete a table A object with no table B relationship I get the
>following error:
>
>recordDeleteForObject: com.webobjects.eoaccess.EODatabaseContext
>com.webobjects.eoaccess.EODatabaseContext@242445 failed to find a
>snapshot for EO with Global ID:_EOIntegralKeyGlobalID[TableB
>(java.math.BigDecimal)2.000000000000000000000000000000] that has been
>deleted from
>com.webobjects.eocontrol.EOEditingContextcom.webobjects.eocontrol.EOEdit
>ingContext@5ae101. Cannot delete an object that has not been fetched
>from the database
>
>It looks like WO is trying to delete the table B object even though it
>does not exist. Am I doing this wrong or is this some kind of bug?
>
>
>--Albert
>
>
>This e-mail (including any attachments) is covered by the Electronic
>Communications Privacy Act, 18 USC. 2510-2521. It is confidential and
>may be legally privileged. If you are not the intended recipient, you
>are hereby notified that any retention, dissemination, distribution, or
>copying of this communication is strictly prohibited. Please reply to
>the sender that you have received the message in error, and then delete
>it. Thank you.
>_______________________________________________
>webobjects-dev mailing list | email@hidden
>Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>Do not post admin requests to the list. They will be ignored.
>
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.