title: SQLAlchemy bulk update query fails with AttributeError
body: <p>Following are model and relationship configurations I have, (not a practical example)</p>
  
  <pre><code>class MyUser(Base):
      __tablename__ = 'my_user'
      id = Column(Integer, primary_key=True)
      name = Column(String)
  
  
  class Address(Base):
      __tablename__ = 'address'
      id = Column(Integer, primary_key=True)
      email = Column(String)
      my_user = relationship("MyUser", backref="addresses", cascade='save-update, merge')
      _my_user_id = Column('my_user_id', Integer, ForeignKey('my_user.id'), nullable=True)
  
  
  &gt;&gt;&gt; user = db_session.query(User).get(6)
  &gt;&gt;&gt; add = models.Address(email='test2@test2.test2', my_user=user)
  &gt;&gt;&gt; db_session.add(add)
  &gt;&gt;&gt; db_session.commit()
  &gt;&gt;&gt; db_session.query(models.Address).filter_by(my_user=user).update(values=dict(email='test3@test3.test3'))
      Traceback (most recent call last):
        File "&lt;stdin&gt;", line 1, in &lt;module&gt;
        File "&lt;hidden&gt;/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 3345, in update
          update_op.exec_()
        File "&lt;hidden&gt;/lib64/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 1178, in exec_
          self._do_pre_synchronize()
        File "&lt;hidden&gt;/lib64/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 1254, in _do_pre_synchronize
          query.session.identity_map.items()
        File "&lt;hidden&gt;/lib64/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 1256, in &lt;listcomp&gt;
          eval_condition(obj)]
        File "&lt;hidden&gt;/lib64/python3.6/site-packages/sqlalchemy/orm/evaluator.py", line 109, in evaluate
          right_val = eval_right(obj)
        File "&lt;hidden&gt;/lib64/python3.6/site-packages/sqlalchemy/orm/evaluator.py", line 65, in &lt;lambda&gt;
          return lambda obj: get_corresponding_attr(obj)
      AttributeError: 'Address' object has no attribute 'my_user_id'
  </code></pre>
  
  <p>This works fine when,</p>
  
  <pre><code>&gt;&gt;&gt; db_session.query(models.Address).filter_by(my_user=user).update(values=dict(email='test3@test3.test3'), synchronize_session=False)
  &gt;&gt;&gt; db_session.query(models.Address).filter_by(_my_user_id=user.id).update(values=dict(email='test3@test3.test3'))
  </code></pre>
  
  <p>Even it works after session close,</p>
  
  <pre><code>&gt;&gt; db_session.close()
  &gt;&gt;&gt; db_session.query(models.Address).filter_by(my_user=user).update(values=dict(email='test3@test3.test3'))
  </code></pre>
  
  <p>Is there something wrong with update query? Why it works in other cases?</p>