Hi All

We have run into a bit of a brick wall with Iterators and was hoping
someone could point us in the right direction.

To illustrator the problem I'll use an example:

We have a UserGuideRecord object which has a title, a document and a
many to many relationship to RoleRecord objects.The semantics of this
relationship are - which user roles is this user guide relevant to.

If I have an existing user guide and I want to edit it and modify the
roles I currently go through the following process:

- Load the existing UserGuideRecord
- Get the UserGuide_RoleIterator
- Delete all the current relationships from the iterator
- Add the new/current relationships into the iterator
- Validate the record
- If no errors were found, save the record, otherwise return the user
to the form

The problem is that if validation fails, all the existing
relationships have been deleted and are now lost.

We had originally assumed that deleteAll - marked items for deletion
and that until save() was called, no write operations were performed
on the database. However this is not the case - deleteAll() physically
deletes everything in the iterator from the pivot table.

Does anyone have any suggestions about how to work around this?


Cheers

Mark






--
Mark Stanton
Gruden Pty Ltd
http://www.gruden.com


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to