c# 4.0 - What CurrentSessionContext to use with Tasks -


when using currentsessioncontext tasks, context should used?

i have been using threadstatic context, , warnings nhprof same session being used in multiple threads.

if using threadstatic should fine. should use different session per thread if used properly. typically use following use session context:

// open session if there not 1 opened yet. if (!currentsessioncontext.hasbind(sessionfactory)) {     currentsessioncontext.bind(sessionfactory.opensession()); }  var currentsession = sessionfactory.getcurrentsession(); 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -