Hi Marcin,

My question is "How to rollback on database level instead of the Model
level".

On Sep 11, 12:53 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
> Please - did you even look at the api ?
> Look what commit and rollback do - its very 
> simple.http://api.cakephp.org/1.2/dbo__source_8php-source.html#l01529
> --
> Marcin Domanskihttp://kabturek.info
>
> On Thu, Sep 11, 2008 at 7:09 AM, [EMAIL PROTECTED]
>
> <[EMAIL PROTECTED]> wrote:
>
> > well, is there any way to rollback the whole change on every table? I
> > don't want to call commit/rollback on every model.
>
> > On Sep 10, 12:54 am, "Anuj Chauhan" <[EMAIL PROTECTED]> wrote:
> >> yes exactly.
>
> >> On Wed, Sep 10, 2008 at 1:10 PM, [EMAIL PROTECTED] <
>
> >> [EMAIL PROTECTED]> wrote:
>
> >> > Thanks for your reply.
>
> >> > Not quit understand what you said. Possible I need something like,
>
> >> > CakePHP->begin()
> >> > //Do some update/modification
> >> > if (succeed)
> >> >  CakePHP->commit()
> >> > else
> >> >  CakePHP->rollback()
>
> >> > I need the CakePHP->rollback to undo all change regardless of any
> >> > model I changed. rollback(&$model) just rollback the change made on
> >> > this model, am I right?
>
> >> > Anuj Chauhan wrote:
> >> > > Hi,
>
> >> > > There is also a function rollback(&$model). make check with your all
> >> > queries
> >> > > if any of them get fails then rollback() it and begin transaction 
> >> > > again.
> >> > you
> >> > > can also modify rollback() function accordingly if it needs always.
>
> >> > > Thanks,
> >> > > Anuj Chauhan.
>
> >> > > On Wed, Sep 10, 2008 at 11:42 AM, [EMAIL PROTECTED] <
> >> > > [EMAIL PROTECTED]> wrote:
>
> >> > > > Hi,
>
> >> > > > I am confused by cakephp transaction. Assume I have two tables like
> >> > > > User, Product. When I start the transation, the code looks like,
>
> >> > > > $this->User->begin()
> >> > > > ...
> >> > > > $this->User->commit()
>
> >> > > > The question is, if any code between the above two lines failed to
> >> > > > update/insert row in table Product, does it rollback? Does 
> >> > > > $this->User-
> >> > > > >begin() mean we just start the transation on table User?
>
> >> > > > I'd appreciate your help very much.
>
> >> > > > Thanks,
> >> > > > Bo
--~--~---------~--~----~------------~-------~--~----~
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