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.

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