On 8/14/07, Michael Lackhoff <[EMAIL PROTECTED]> wrote:
> On 14.08.2007 20:34 John Siracusa wrote:
> > On 8/14/07, Michael Lackhoff <[EMAIL PROTECTED]> wrote:
> >> $db->begin_work;
> >> my $obj = Products->new(db => $db);
> >> ...
> >> $obj->save;
> >> some_helper_that_uses_db(); # rollback here
> >> my $obj2 = Customers->new(db => $db);
> >> ...
> >> $obj2->save;
> >> $db->commit;
> >>
> >> When I ran this code $obj2 was saved but $obj was rolled back.
> >
> > Was there ever a commit after $obj->save but before the rollback in
> > some_helper_that_uses_db()?
>
> No, only the one commit at the very end.

Assuming your have AutoCommit turned off, that's why $obj was not
saved.  The rollback rolled back everything done since the last
begin_work().

-John

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to