1/ to be session aware interecptor, you must be specified at OpenSession
time. Nhibernate supports configuration time interceptors, but they are not
session aware, for multi threading safety reasons
2/ a patch would be welcome.

On Sat, Oct 11, 2008 at 1:40 AM, Will Shaver <[EMAIL PROTECTED]> wrote:

> in NHibernateUnitOfWorkFactory
>
> if (IoC.Container.Kernel.HasComponent(typeof(IInterceptor)))
> {
>    IInterceptor interceptor = IoC.Resolve<IInterceptor>();
>    ...
>
> If the IInterceptor is set up in the windsor config with the default
> implementation it will be a singleton. When OpenSession is called in
> NHibernate it will:
>
> if (sessionLocalInterceptor != null)
> {
>    sessionLocalInterceptor.SetSession(session);
> }
>
> So if we have more than one session open at once - easy to do for a web app
> - we could be causing a clobbering of the session stored in the interceptor
> right?
>
> If so, do you recommend that you
>
>  #1 Use UnitOfWork.CurrentSession instead of relying on SetSession() with a
> local var
>  #2 Set up the lifestyle of the Interceptor to be something other than
> singleton, and if so what?
>
>  - Will
>
>
>
>
>
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" 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/rhino-tools-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to