Well, keep in mind that CakePHP uses transactions by default when
saving multiple records, which MyISAM does not support. If you want to
switch to MyISAM, you'll need to pass the 'atomic' option in
Model::saveAll() as false. So:
$this->Model->saveAll($data, array('atomic' => false));
>From your comments it sounds like you might already be doing this, but
just making sure.
Other than that, the switch is OK. CakePHP doesn't use the actual
CASCADE feature of InnoDB - it just imitates it by iterating through
dependent hasMany and hasOne relationships. So that behaviour will
continue no matter what storage engine you're using. If you want to
stop Cake's own cascading behaviour, you need to set dependent to
false in your hasMany and hasOne relationships.
On Aug 14, 1:26 pm, JamesF <[email protected]> wrote:
> Whnn I first set up the current app I am using, I chose InnoDB tables
> for almost any Model that i thought would be related. My thinking was
> that Cake wouldn't understand the foreign key relationships and it
> would lead to database integrity problems.
>
> I am assuming that Cake doesn't care which storage engine I use in the
> case of simple model relationships. I am not using transactions or row
> level locking currently, and more often then not, the CASCADE effect
> of InnoDB tables has made some of my data go bye-bye.
>
> I appreciate that InnoDB prevents me from inserting data with
> incorrect id's and fk id's but it also deletes child data when i don't
> want it to (unless i use RESTRICT or SET NULL on that fk).
>
> So the crux of my question is this, can I maintain my current app
> functionality while converting back to MyISAM tables, considering I do
> not use any advanced InnoDB features? Will Cake still handle my table
> relationships correctly when I am following proper naming conventions
> for foreign keys and table names?
--~--~---------~--~----~------------~-------~--~----~
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=en
-~----------~----~----~----~------~----~------~--~---