Description
Between version 5.3.10 and 5.3.11 the behaviour of cached SQL Query results changed when using AliasToBean transform.
ISession session;
session.CreateSQLQuery("select 'REGIONCODE' as regionCode ")
.AddScalar("regionCode", NHibernateUtil.String)
.SetResultTransformer(Transformers.AliasToBean<ResultDto>())
.SetCacheable(true)
.List();
This works the first time through when caching is enabled, but when run again it fails with a "System.InvalidOperationException : This transformer is not initialized" exception.
I've created the attached Test Case which gives the exception in the second call to .List in the GetCacheableSqlQueryResults method.
In my actual code the SELECT statement involves tables and join, etc - its been simplified for this test case to not include any entities.