This applies to named queries. I don't have a named query here and named queries are not an option for me, as the sql is generated at runtime. Is there any other way to prevent cached items to slip into my query result set?
On 22 Sep., 16:22, Fabio Maulo <[email protected]> wrote: > <synchronize table="YourTable"/> > > 2009/9/22 merrycoder <[email protected]> > > > > > > > Sorry, i could not find anything useful on how to specify the query- > > space: > > > How do i do that exactly? > > > On 22 Sep., 15:33, Fabio Maulo <[email protected]> wrote: > > > for SQL and/or H-SQL queries you should specify the query-space > > > sync.<synchronize > > > table="YourTable"/> > > > > 2009/9/22 merrycoder <[email protected]> > > > > > 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 > > > > -- > > > Fabio Maulo > > -- > Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
