Thanks Fabio, naturally there's next question: you can get current contextual session by calling ISessionFactory.GetCurrentSession(), but how do you get current ISessionFactory? Do I still have to implement some public static field with ISessionFactory, or is it also somehow built into NHibernate? Rafal
On Aug 3, 3:50 pm, Fabio Maulo <[email protected]> wrote: > http://nhforge.org/doc/nh/en/index.html#architecture-current-session > > 2009/8/3 rg <[email protected]> > > > > > > > > > Hi, I'd like to add some logic to my data objects by implementing > > additional methods. However, these methods have to access current > > ISession to be able to load or update any data. I could pass the > > ISession as a parameter to each method, but this is unacceptable for > > some reasons. It would be better if current session was stored > > somewhere where it can be publicly accessed - for example in thread > > local storage, so it can be retrieved by all methods executed in > > current thread. > > Passing ISession to each method is unacceptable because I want to call > > these methods using Ajax-RPC and certainly don't want to deal with > > ISession parameter client side (NH session is managed externally by > > RPC controller). Of course I can go with thread local storage, but > > maybe you have better ideas. > > Best regards > > Rafal > > -- > Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
