Delay with EO deletion?
Delay with EO deletion?
- Subject: Delay with EO deletion?
- From: Pascal Robert <email@hidden>
- Date: Tue, 07 Feb 2012 15:39:24 -0500
Hi guys,
I have a problem with an editing context, look like it's a delay when I delete objects (objects that are not yet in the database). So in short, people create transactions (not database transactions) when they add items to a job (just like when you add stuff in a shopping cart) and can decide to remove a transaction from the job. When they remove an item from the job, I do:
rootTransaction.deleteSubTransactionsRelationship(transactionItem);
editingContext().deleteObject(transactionItem);
But when the page reload (by a Ajax call), the list of available items is not updated. Example:
- I have Item 1 and Item 2 available to put in the job
- I add Item 1 to the job, it's not available to pick up, that's what I want
- I add Item 2 to the job, it's not available to pick up, that's what I want
- I remove Item 1 from the job, so that's calling the deleteObject() and deleteSubTransactionsRelationship() methods. Item 1 disappears from the job (ok), but it's not available for picking up (bad).
- I remove Item 2 from the job, and now Item 1 is available for pickup! But Item 2 is still not available, until I do a revert on the editing context and redo the steps.
If I print editingContext().deletedObjects() after the call to editingContext().deleteObject(transactionItem), I see that the item (Item 2) I'm removing is in the array. If I print it again when I delete I ten 2, the only object in editingContext().deletedObjects() is Item 2, Item 1 is not in it anymore.
So the question: is there some kind of delay when you delete an object in the EC and just after you use a relationship (the relationship is for finding the available items)?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden