My::News->global_datasource_handle->{AutoCommit} = 0; eval { $news_article->save; $news_category->save; $news_author->save; foreach my $news_topic ( @topics ) { $news_topic->save; } }; if ( $@ ) { My::News->global_datasource_handle->rollback; } else { My::News->global_datasource_handle->commit; } My::News->global_datasource_handle->{AutoCommit} = 1;