Questions about nhibernate.
Posted
by
chobo2
on Stack Overflow
See other posts from Stack Overflow
or by chobo2
Published on 2011-01-16T04:40:09Z
Indexed on
2011/01/16
4:53 UTC
Read the original article
Hit count: 163
nhibernate
Hi
I have a couple questions about nhibernate.
I still don't understand what contextual sessions means. I do web stuff so I just choose "web" but I really don't know what it is doing.
Should I put session.BeginTransaction() in Application_BeginRequest?
Should I commit everything in Application_EndRequest? Or should I commit when needed. Say I need to insert a user and then down in some code later I need to update some other table. Should I make the user and do the update then finally commit or should I wait till both are ready to be commited?
Should you always have session.Rollback() in Application_EndRequest?
Should I session.close() or session.dispose() or both in Application_EndRequest?
© Stack Overflow or respective owner