From dd3dcd299ef0aed94984e6e1f0a822821365f715 Mon Sep 17 00:00:00 2001 From: Naveed Massjouni Date: Fri, 9 May 2014 11:51:26 -0700 Subject: [PATCH] updated discard_changes docs regarding { force_pool => 'master' } --- lib/DBIx/Class/Row.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index 000498ae6..6e38162a0 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