We're building a large application with NHibernate as ORM layer. We've 
tried to apply as many best practices as possible, among which setting 
FlushMode to Never. However, this is giving us pain, for example the 
following scenario:

There is a table with an end date column. From this table, we delete the 
last (by end date) record:


   - The record is deleted;
   - After the delete, we do a (repository) query for the last record (by 
   end date);
   - This last record is updated because it's the new active record.

This is a very simple scenario, of which many exist. The problem here is 
that when we do the query, we get the deleted record back, which of course 
is not correct. This roughly means that we cannot do queries in business 
logic that may touch the entity being inserted or deleted, because its 
resp. not there yet or still there.

How can I work with this scenario? Are there ways to work around this 
without reverting the FlushModesetting or should I just give up on the 
FlushMode setting all together?

(this is a cross-post from 
http://stackoverflow.com/questions/18761613/problems-with-nhibernate-flushmode-never
)

-- 
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/groups/opt_out.

Reply via email to