Skip to content

Running queries on ReadCommitted (Question) #2731

Answered by hazzik
fairking asked this question in Q&A
Discussion options

You must be logged in to vote
What's your default flush mode?

I described it in the configuration above. Commit.

This is really the answer to your question.

The queries do not do in-memory post process checks of the fetched data. It is just returns the results from the database (or a L2 cache if it is enabled for query). This would be extremely hard task to implement (and sometimes impossible) and then it would bring more inefficiencies. Consider this query:

var ids = session.Query<Contact>().Where(x => x.IsDeleted == false).Select(x => x.Id).ToList();

Look how there is no IsDeleted column in the result and so NHibernate would not be able to filter these IDs further in memory.

To avoid stale query result there are …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by hazzik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2730 on April 15, 2021 23:13.