I've sought help in #cakephp, and the consensus reached seems to be
that I might have stumbled upon a bug with saveAll, though I'm still
not convinced I'm not missing something simple.

Here's the basics:
Models:
Model1 hasMany Model2
Model3 hasAndBelongsToMany Model1
Model3 hasMany Model4

Data:
save1 = array(
[Model1] => array(...)
[Model2] => array(array(...))
)
save2 = array(
[Model3] => array(...)
[Model4] => array(array(...))
)

When all of the data passes validation, all of the records are
correctly inserted, including the records in the Model3-Model1 habtm
join table.  When the second save fails validation, however,
everything rolls back as expected except the records for Model1.  The
records for Model2 (which were created in the same saveAll) do
rollback.

I was also able to replicate this unintended behavior with very simple
models in a fresh new app, so I highly doubt it's due to my database
relationships.

Any ideas?  I'm happy to elaborate if necessary.

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=.


Reply via email to