Hi Jason, Thank you for answers. I am right now running into an issue. I have created another thread http://groups.google.com/group/nhusers/browse_thread/thread/6fe13af2e7ffa38c/eaf2b816b296c197#eaf2b816b296c197. As far as my understanding/ guessing that, NServiceBus handler is sharing the session with the WCF application. If I fix Handler to create new session every thread, that could solve the issue. My code already is creating the new session for each thread. But not sure, why still throwing the error. Thats Y i wanted to make that code does create new session. Can you help me how to track down this issue? I am rightnow no where on this.
On Aug 30, 5:57 am, Jason Meckley <[email protected]> wrote: > you can check out the source, but I don't think this would be part of > the public API. typically there isn't a need to know which thread or > session you are on. > > On Aug 27, 5:00 pm, Amzath <[email protected]> wrote: > > > > > I am using NHibernate facility from Castle Project. There is a > > session id property can I use that? > > > On Aug 27, 10:49 am, Jason Meckley <[email protected]> wrote: > > > > one last thing. once the session is bound to the context use > > > factory.GetCurrentSession() to access the opened session. > > > > On Aug 27, 12:47 pm, Jason Meckley <[email protected]> wrote: > > > > > I use the thread context (current session context) for messaging > > > > services. > > > > in my config file... > > > > <property name="current_session_context">thread</property> > > > > > //when a message is received. > > > > if(CurrentSessionContext.HasBind(factory)) return; > > > > > var session = factory.OpenSession(); > > > > CurrentSessionContext.Bind(session); > > > > > //when a message finishes processing > > > > if(CurrentSessionContext.HasBind(factory) == false) return; > > > > > var session = CurrentSessionContext.Unbind(factory); > > > > session.Dispose(); > > > > > With rhino.servicebus the mechanism for handling this is called > > > > IMessageModule. NServiceBus has a similar interface, but i don't know > > > > the name of it. as long as you do not pass entities in a message you > > > > will be ok. otherwise you need to deal with disconnecting and > > > > reconnecting the object to the session. a DTO is much easier to work > > > > with and much more explicit. > > > > > On Aug 27, 12:19 pm, Amzath <[email protected]> wrote: > > > > > > We are running into an session issue in multi-threaded WCF and > > > > > NService bus application. How to check in whether each thread is using > > > > > its own session? Are there any properties in session object tells > > > > > about that? I wanted to log the session id's (if there is one) for > > > > > each thread in log file.- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - -- 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.
