Hi there,
I have an issue with the following sql query:
// query the user's with static value 'foo' as Name:
IList<User> list = nhibernateSession.CreateSQLQuery("select 'foo' as
{us.Name} from User us").AddEntity("us", typeof(User)).List<User>();
foreach (User u in list)
Debug.WriteLine(u.Name); // Output is 'foo'. Correct!
// Overwrite the Name in cache
foreach (User u in list)
u.Name = "bar";
// Rerun the same query
list = nhibernateSession.CreateSQLQuery(sql).AddEntity("us", typeof
(User)).List<User>();
foreach (User u in list)
Debug.WriteLine(u.Name); // Output is 'bar'; Wrong IMHO!
I would expect the Name to be 'foo' as it is overwritten in the query.
Any ideas on how to handle this without clearing the cache?
Thanks
Stefan Landgraf
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---