NHibernate: Change from lazy=true to fetch=join brings back the world
I have a User object/mapping in my application. Each user has a list of contact information (phone, email etc)

the mapping for the user contains:


    <bag name="ContactInfo" table="contact_info" lazy="true" cascade="all">
        <key column="contact_id"/>
        <one-to-many class="...ContactInfo, ..."/>
    </bag>

this works fine but i get the n+1 select problem so i need to optimize it a little bit. But for some reason, when I change this to a join and perform some db operation, NH starts updating ALL contact_info objects in the database. When i say db operation i dont mean changinf a contact. i mean anything. 

Anyone knows why? thx
NHibernate: Change from lazy=true to fetch=join brings back the world
===

I have a User object/mapping in my application. Each user has a list of contact information (phone, email etc)

the mapping for the user contains:


    <bag name="ContactInfo" table="contact_info" lazy="true" cascade="all">
        <key column="contact_id"/>
        <one-to-many class="...ContactInfo, ..."/>
    </bag>

this works fine but i get the n+1 select problem so i need to optimize it a little bit. But for some reason, when I change this to a join and perform some db operation, NH starts updating ALL contact_info objects in the database. When i say db operation i dont mean changinf a contact. i mean anything. 

Anyone knows why? thx