.. change::
   :tags: bug, orm
   :tickets: 4507

   Fixed a regression in 1.2 due to the introduction of baked queries for
   relationship lazy loaders, where a race condition is created during the
   generation of the "lazy clause" which occurs within a memoized attribute. If
   two threads initialize the memoized attribute concurrently, the baked query
   could be generated with bind parameter keys that are then replaced with new
   keys by the next run, leading to a lazy load query that specifies the
   related criteria as ``None``. The fix establishes that the parameter names
   are fixed before the new clause and parameter objects are generated, so that
   the names are the same every time.
