I am using RavenDB 3.5.
I know that querying entities is not acid
but loading per ID is.
Apparently writing to DB is also acid
.
So far so good.
Now a question:
I've found some code:
session.Advanced.WaitForIndexesAfterSaveChanges();
entity = session.Load<T>(id);
session.Delete(entity);
session.SaveChanges();
// Func<T, T> command
command?.Invoke(entity);
what would be the purpose of calling WaitForIndexesAfterSaveChanges()
here?
is this because of executing a command?
or is it rather because might depedning/consuming queries are supposed to immediately catch up with those changes made?
if this would be the case, I could remove WaitForIndexesAfterSaveChanges()
in this code block and just add WaitForNonStaleResultsAsOfNow()
in the queries, couldn't I?
When would I use WaitForIndexesAfterSaveChanges()
in the first place if my critical queries are already flagged with WaitForNonStaleResultsAsOfNow()
?