I seem to miss something here :
I have an application that uses a session per application method and using lazy loading.
I've set the session FlushMode.Commit and it seems that NHibernate still auto saves my dirty objects to the DB (SQLCe) although I never begin a transaction and commit it.
can anyone tell me what am I doing wrong ?
some of my code :
public Repository(ISessionProvider sessionProvider)
{
_sessionProvider = sessionProvider;
_session = _sessionProvider.OpenSession();
_session.FlushMode = FlushMode.Commit;
}
public IList<T> GetAll<T>() where T : class
{
var criteria = _session.CreateCriteria<T>();
var list = criteria.List<T>();
return list;
}
FlushMode.Neverif you do not need this behavior. - Andreas