X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRow.pm;h=a6f5f7706a082ffefb26162b76174b88be969355;hb=daf4e3bed37d35feb43338142935dcb4c61313b8;hp=ad4182c66348c6bd1484c4acbfd0e8cebb4502aa;hpb=1e1ce814212b6f20cd7e16f17249d33dd7502692;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index ad4182c..a6f5f77 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -377,7 +377,7 @@ sub insert { my $re = $self->result_source ->related_source($relname) ->resultset - ->find_or_create($them); + ->create($them); %{$obj} = %{$re}; MULTICREATE_DEBUG and warn "MC $self new $relname $obj"; } @@ -1332,6 +1332,13 @@ This method can also be used to refresh from storage, retrieving any changes made since the row was last read from storage. Actually implemented in L +Note: If you are using L as your +storage, please kept in mind that if you L on a row that you +just updated or created, you should wrap the entire bit inside a transaction. +Otherwise you run the risk that you insert or update to the master database +but read from a replicant database that has not yet been updated from the +master. This will result in unexpected results. + =cut 1;