From: Naveed Massjouni Date: Fri, 9 May 2014 18:51:26 +0000 (-0700) Subject: updated discard_changes docs regarding { force_pool => 'master' } X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dd3dcd299ef0aed94984e6e1f0a822821365f715;p=dbsrgits%2FDBIx-Class-Historic.git updated discard_changes docs regarding { force_pool => 'master' } --- diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index 000498a..6e38162 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -1492,11 +1492,11 @@ $attrs, if supplied, is expected to be a hashref of attributes suitable for pass second argument to C<< $resultset->search($cond, $attrs) >>; 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. +storage, discard_changes by default will behave as if you provided +C<{ force_pool => 'master' }> in order to guarantee that fresh results are +read from the master database. +The documentaion previously suggested to wrap calls to discard_changes with a +transaction in order to get this behavior, but that is no longer necessary. =cut