nhibernate/nhibernate-core — pull request #201 by denisborovnev (2013-04-14 13:23:16+00:00)
Title: test and fix propose for NH-3436

Problem in QueryPlanCache :

if (planExpression != null && expression != null)
{
//NH-3413
//Here we have to use original expression.
//In most cases NH do not translate expression in second time, but
// for cases when we have list parameters in query, like @p1.Contains(...),
// it does, and then it uses parameters from first try.
//TODO: cache only required parts of QueryExpression
planExpression._expression = expression._expression;
planExpression._constantToParameterMap = expression._constantToParameterMap;

because other threads sometimes override expression and constatToParameter map during execution of current query

note : theoretically test can be passed successfully sometimes but on my machine it always fails.