On 14.08.2007 20:20 Bill Moseley wrote:

> On Tue, Aug 14, 2007 at 11:57:27AM +0200, Michael Lackhoff wrote:
>> my $db = MyApp::DB->new;
>> $self->my_db($db); # a new db for a new transaction
>> $db->begin_work;  # Start transaction
>> 
>> ... create two objects and save them ...
>> 
>> die "Does it roll back?";
>> $db->commit;
>> 
>> But when I run this script the two records are saved to the database and
>> not rolled back.
> 
> Have you also looked at Roes::DB's do_transaction() ?

I know that this is another possible variant but because there is so
much code I didn't want to squeeze it into a single call. It would do
after some reorganization but I don't think there is much difference
between begin_work/commit and do_transaction, at least the docs don't
mention it, so I didn't try.

- Michael

-------------------------------------------------------------------------
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