• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem with locking and deleting with many-to-many relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with locking and deleting with many-to-many relationship


  • Subject: Re: Problem with locking and deleting with many-to-many relationship
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 26 Nov 2003 13:43:57 -0800

The FOR UPDATE looks suspicious.  Two things to check very carefullly:

- value types in model
- relationship definitions and flattened properties in the model

Mistakes in the model can make EOF crazy.  :-)

Chuck


At 01:50 PM 26/11/2003 -0700, Gerald Hanks wrote:
>I have a flattened many-to-many relationship from item to option which uses
>three tables: item, option, and item_option.  The item object has a flattened
>attribute called options.
>
>When I add an option to the options list using
>
>anItem.addToOptions(anOption) I get the following SQL on saveChanges()
>
>INSERT INTO item_option(item_id, option_id) VALUES (1, 8)
>
>This would seem to be correct
>
>When I remove an option from the options list using
>
>anItem.removeFromOptions(anOption) then I get the following SQL on
saveChanges()
>
>SELECT t0.item_id FROM item_option t0 WHERE t0.option_id = 8 FOR UPDATE
>DELETE FROM item_option WHERE option_id = 8
>
>This seems to be in error since this SQL would remove option 8 from all
items not
>just the one being updated.  In fact if there are two items with option 8 and
>I try to delete option 8 from either item I get a locking failure telling me
>that more than one row was locked.
>
>Can anyone help me on this one.  I am kind of stuck for the time being.
>
>-gerald
>_______________________________________________
>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.

References: 
 >Problem with locking and deleting with many-to-many relationship (From: Gerald Hanks <email@hidden>)

  • Prev by Date: Re: SSL: images not appearing
  • Next by Date: Re: Filtering an array of EO objects in D2J (making progress - learning heaps)
  • Previous by thread: Problem with locking and deleting with many-to-many relationship
  • Next by thread: Re: Problem with locking and deleting with many-to-many relationship
  • Index(es):
    • Date
    • Thread