We have a few queries where we are pulling predicate expressions into the select clause so that we can batch a complex set of queries.
Our problem is that when entity comparison is part of the predicate the expression is not sent to the database but rather broken and the comparison is run in memory. The query plan (including the ProjectionExpression) is then cached. Subsequent executions try to compare the newly returned entity with the cached entity, which will fail if the entity was from a different session.
Trivial, but clear example
The first time the query executes (within an ISessionFactory instance) the values of OwnedByBob correctly reflect the ownership. Subsequent executions will have all OwnedByBob values false.