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

Filed under:

Hi

I have a couple questions about nhibernate.

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

  2. Should I put session.BeginTransaction() in Application_BeginRequest?

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

  4. Should you always have session.Rollback() in Application_EndRequest?

  5. Should I session.close() or session.dispose() or both in Application_EndRequest?

© Stack Overflow or respective owner

Related posts about nhibernate