my $label = shift;
my $path = shift;
my $ed = shift;
+ my $red = shift;
my $outer = 0;
if (!$ed) {
my $str_path = join('.', @$path);
$obj = $_object_by_path_cache{$def_id}{$str_path}{$step}{$ffield}{$lval} ||
- $ed->$meth( ($multi) ? { $ffield => $lval } : $lval);
+ (
+ (grep /cstore/, @{
+ Fieldmapper->publish_fieldmapper->{$fclass}{controller}
+ }) ? $ed : ($red ||= new_rstore_editor(xact=>1))
+ )->$meth( ($multi) ? { $ffield => $lval } : $lval);
$_object_by_path_cache{$def_id}{$str_path}{$step}{$ffield}{$lval} ||= $obj;
}
for (@$obj_list) {
my @path_clone = @$path;
- $self->_object_by_path( $_, $collector, $label, \@path_clone, $ed );
+ $self->_object_by_path( $_, $collector, $label, \@path_clone, $ed, $red );
}
$obj = $$obj_list[0] if (!$multi || $rtype eq 'might_have');
}
}
- $ed->rollback if ($outer);
+ if ($outer) {
+ $ed->rollback;
+ $red->rollback if $red;
+ }
return $obj;
}