Author Login
Post Reply
Hi, i post this question to the dev list because i think about it to add
this to nhibernate.
We have an Order object with a large object graph where we use lazy
loading overall to avoid long loading times.
Now we need to support a changeable mode where the user can discard all
changes he make in the Order object graph. To do this, we Evit the Order
object and read load it in the original state from Database.
The huge problem now it that we use the session for all operation in our
app. In example the user can create OrderReminders where i pass the
Order object as reference. ( This objects are created and deleted
outside the order itself, because they should no care about discarding
changes ).
When i now save or delete such object and call flush all changes (
including this one from my order object ) are flushed to database.
I can not use Evict, because it disables lazy loading. And i can not use
more the one session, because then ive got an order ( the lazy loaded
collection ) are already connected to a session exception when i try to
save an OrderReminder ( with a reference to my order object ).
What i need is to disable the automatic change tracking and allow
nhibernate only flushing changes when i call session.Update for my
object before flush.
Steve
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nhibernate-development mailing list
Nhibernate-development@(protected)
https://lists.sourceforge.net/lists/listinfo/nhibernate-development