Hello.

i'm playing with saveAll

here's the array i'm saving

Array (
        [Commessa] => Array (
                [Codice] => [XXX]
        )
        [OggettiPerCommessa] => Array (
                [1] => Array (
                        [FieldA] => "AAA"
                        [FieldB] => "BBB"
                )
                [2] => Array (
                        [FieldA] => "AAA"
                        [FieldB] => "BBB"
                )
        )
)

and here's my SQL log (Describe queries omitted)

10      START TRANSACTION
11      START TRANSACTION
12      SELECT COUNT(*) AS `count` FROM `commesse` AS `Commessa` WHERE
`Commessa`.`Codice` = 'XXX'
13      SELECT COUNT(*) AS `count` FROM `commesse` AS `Commessa` WHERE
`Commessa`.`Codice` = 'XXX'
14      INSERT INTO `commesse` (`Codice`) VALUES ('XXX')
15      SELECT LAST_INSERT_ID() AS insertID
16      INSERT INTO `riparazioni` ('Commessa', `FieldA`, 'FieldB') VALUES
(10, 'AAA', 'BBB')
17      SELECT LAST_INSERT_ID() AS insertID
18      INSERT INTO `riparazioni` ('Commessa', `FieldA`, 'FieldB') VALUES
(10, 'AAA', 'BBB')
19      SELECT LAST_INSERT_ID() AS insertID
20      COMMIT

everuthing is working ok but...

- Why saveAll uses 2 transactions?
- Why so many "SELECT LAST_INSERT_ID() AS insertID"?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to