when implementing session per request, entities that are saved in session state get detached and re-attached to an nhibernate session all the time i've noticed that the session has no way of knowing if the entity is dirty or not because this is a new session and the entity was just attached. it results with sqls that could have been avoided (with select before updated its the select, or else an unneccessay update)
i was just curious to know (i'm very curious today in general) how are you guys handling this are you ok with the extra selects? are you using a statefull entities with interceptors to determine weather the entity is modified (or which properties are dirty if using dynamic updates)? can you think of a better solution (i was thinking that it could be possible to use proxies for these entities that save their previous state in the proxy instead of in the session, then the previous state could be reserved over multiple sessions, and also RejectChanges could be implemented without an extra query)? all of these stuff are only ok for scenarios where there is a small to no chance of a concurrency issue on these particular entities of course -- 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.
