Today I have a problem where I want to share two projects. Each
project has its own factory and both make use of
[Factory.GetCurrentSession].

Both share this similar method:

        public static void Bind()
        {
            if
(NHibernate.Context.CurrentSessionContext.HasBind(Factory))
            {
                throw new ApplicationException("Already an NHibernate
session bound!");
            }

            Log.Debug("Bind NHibernate session");
 
NHibernate.Context.CurrentSessionContext.Bind(Factory.OpenSession());
        }

So for each project I call their respective Bind methods but when I
call Bind of project A followed by Bind of project B the
[CurrentSessionContext.HasBind] method returns true.

I did not really expected this as it expects a factory instance and I
expected that this is used to lookup the correct session using the
passed factory as a reference.


I searched for a solution but couldn't find one. Does anybody knows a
solution?

Is this expected behaviour as I expected to have a context per factory
instance.


Grtz,
Ramon
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to