Thanks again Gunnar. I am only using session on a single dedicated thread,
so that should be OK.
In my code Session.Query does not return deleted entities where there is no
flush; the only way to resolve this is to try a small sample - I will be
very interested if you are able to post code that does return deleted
entities.
public void Delete(
T model,
bool persist = true)
{
QueueTask(
() =>
{
using (ITransaction txn = Session.BeginTransaction())
{
Session.Delete(model);
txn.Commit();
}
});
if (persist)
{
QueueFlush();
}
}
The reason I don't always persist with each delete is if I am deleting
multiple items in one go - in that case I do a single Flush at the end for
performance reasons. Queue flush adds the Flush action to a queue that is
executed on the Session thread.
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.