I would re-purpose session2 to only save the data. Save the query for a 
different session. This is how the session would typically behave in a real 
system. either read or write, not both.

I believe 2nd level cache is a non-linear operation. That is, it uses some 
type of background process to keep the cache in sync. a cache represents 
stale data, by using a cache you are accepting the data is not real-time. If 
you need real time data, query the database directly.

to prove this try putting a Thread.Sleep(1000) between the write session and 
read sessions to see if the results are what you expect. If the results are 
what you want, then it's a timing issue. If the results are still in 
accurate, then I'm probably wrong about 2nd level cache being a background 
process. At that point it could be misconfiguration.

-- 
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.

Reply via email to