By design, when a query() fetches an existing object, it doesn't refresh
the values unless populate_existing() is included with the query. The
documentation for populate_existing() states it isn't meant for general
purpose.
Occasionally, however, objects need to be selected FOR UPDATE,
populate_existing() blows away any pending changes on the object so turning it
on by default would be a surprise in a lot of cases.
typically if someone is working with FOR UPDATE they're already programming a
very specific section in a very careful manner, it's not something that's done
I had forgotten the danger of populate_existing() also because we make
it automatically issue a flush() for these purposes. Documentation note
sounds good.
On 3/5/2013 10:45 AM, Michael Bayer wrote:
populate_existing() blows away any pending changes on the object so
turning it on by default