This would allow me to begin and then commit/rollback transactions.
However this does not perform row level locking.
I will show an example to illustrate what I mean.
$DS=$tis->getDataSource();
$DS->begin();
$user=$this->findById(1);
if($user['User']['is_admin'])
{
if($this->save(array('User'=>array('id'=>1,'privileges'=>'all'))))
{
}
}
On Aug 12, 9:29 pm, "Dr. Loboto" <[email protected]> wrote:
> Start transaction, select, save, close transaction. Something like
> this:
>
> $DS = $this->getDataSource();
> $DS->begin();
> $this->find(...);
> if ($this->save(...)) {
> $DS->commit();}
>
> else {
> $DS->rollback();
>
> }
>
> On 11 авг, 00:10, Teddy Zeenny <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > Is there a way in cakephp to use SELECT .. FOR UPDATE (for InnoDB row
> > level locking) without using the $Model::query function (as this is
> > highly not recommended) ?
>
> > If not, does anyone know an alternative ?
>
> > Thanks,
>
> > Teddy
--
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