On Wed, Dec 21, 2011 at 9:52 AM, socrates <[email protected]> wrote:
>
> Thanks all for the help, I solved in this way:
Are you telling us that now transactions are working properly?
> 1) I move the code form the controller to the model. (I don't really
> know if this help!)
> 2) I used the Datasource to start the transaction. (Like explained in
> the docs)
> 3) I commit or rollback with the datasource, but the SQLLog in the
> page shows only the query, and no trace of the transaction SQL code.
That's strange even if I think it is possible cakephp will not log
everything; however, maybe some cakephp-sql expert guys would shed
some light on the subject.
Matteo
>
> Code:
>
> inside the Model
> <?php
> [...]
>
> $ds = this->getDataSource();
> $ds->begin($this);
> $result = $this->saveAssociated('params');
> if ($result) {
> $ds->commit($this); // in the doc there are no trace of this, that
> i have to pass like parameter the refernce to $this.
> } else {
> $ds->rollback($this);
> }
> ?>
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group at
> http://groups.google.com/group/cake-php
>
--
http://www.matteolandi.net/
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php