Hi,

I didn't know that you need to use saveAll() inside transaction. By default,
saveAll() starts new transaction. So change your saveAll() call from

$result = $this->saveAll($data);

to

$result = $this->saveAll($data, array('atomic' => false));

Hope this helps.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Fri, Dec 24, 2010 at 1:30 PM, Zeu5 <kimc...@gmail.com> wrote:

> Hi all,
>
> it did not work.
>
> I have tried
>
> This is for a Merchant Model;
>
> $datasource = $this->getDataSource();
>
> $datasource->begin($this);
>
> $result = $this->saveAll($data);
> if (!$result) {
>  $datasource->rollback($this);
>  return false;
> }
> /**
> * do something to form a $domainData array
> **/
> $result = $this->Shop->Domain->save($domainData);
>
> if (!$result) {
>  $datasource->rollback($this);
>  return false;
> }
>
> // and so on.
>
> // finally the last one has
>
> if (!$result) {
>  $datasource->rollback($this);
>  return false;
> } else {
>  $datasource->commit($this);
> }
>
>
> There is no single transaction to speak of. because if i purposely
> fail the last save() or saveAll(). the previous save and saveAll will
> work.
>
> Please advise.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.com>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

Reply via email to