]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Use identity_token for refresh(), unexpire, undefer
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 3 May 2018 16:35:23 +0000 (12:35 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 11 May 2018 14:41:02 +0000 (10:41 -0400)
commita7eaa6afc818e495987f6ecb39d122ff32430c03
tree4c81032e0b52585d282fa7698cb7b20d9eaf4127
parentf388d15704527c654cb715c66d23e94ebffd25f3
Use identity_token for refresh(), unexpire, undefer

The horizontal sharding extension now makes use of the identity token
added to ORM identity keys as part of :ticket:`4137`, when an object
refresh or column-based deferred load or unexpiration operation occurs.
Since we know the "shard" that the object originated from, we make
use of this value when refreshing, thereby avoiding queries against
other shards that don't match this object's identity in any case.

Change-Id: Ib91637a65d94ace7405998b8410d62944a83f2eb
Fixes: #4247
(cherry picked from commit 4b71933489cae21ad94b71b0bc7271c075ad0dda)
doc/build/changelog/unreleased_12/4247.rst [new file with mode: 0644]
lib/sqlalchemy/ext/horizontal_shard.py
lib/sqlalchemy/orm/loading.py
lib/sqlalchemy/orm/query.py
test/ext/test_horizontal_shard.py