Ok, there's a few concepts to look into.

1) Sessions and Flushing
All work performed by NHibernate happens within the context of a
Session. When you "flush" that session all pending changes in the
session get written.
There is a FlushMode setting at Session level that may cause session
to auto-flush when particular operations (such as update) are called.
That's probably the most likely reason you're seeing database activity
on unexpected objects.

2) Cascades
Another possibility could be a series of cascades setup across your
object model.


On Apr 23, 1:41 am, PLen <[email protected]> wrote:
> Hello,
>
> I am using NHibernate 3 in a C# Windows Forms application that uses
> Oracle 11g in the back.  I have found an odd problem.  I will do a
> query via NHibernate and get back a collection of objects.  Each
> object (GROUP) has a list of sub-objects (DOCUMENT).
>
> Say GROUP 1 has 5 DOCUMENTs.  If I modify one of the DOCUMENT objects
> and then do an NHibernate update call for GROUP 1, I can see that
> NHibernate is only calling an update for the one DOCUMENT that was
> modified.  All seems well there.
>
> If I do the same mod listed above but do an NHibernate update on GROUP
> 2, however, NHibernate calls for an update on the DOCUMENT from GROUP
> 1, which I did not ask to do an update on.
>
> Having NHibernate make update calls for objects that were not part of
> the object of the update call is causing big problems.
>
> Does anyone know why this is happening?  Any insight would be helpful.
>
> Thanks - Peter

-- 
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.

Reply via email to