Although I don't use this approach anymore for managing NH sessions, maybe
you can take some ideas from these posts:
http://blog.schuager.com/2008/11/custom-windsor-lifestyle.html
 <http://blog.schuager.com/2008/11/custom-windsor-lifestyle.html>
http://blog.schuager.com/2009/03/rich-client-nhibernate-session.html

On Wed, Nov 17, 2010 at 8:13 PM, SimonB <[email protected]>wrote:

> Castle Windsor creates multiple instances of grand child objects using
> transient lifestyle.
>
> I have an object graph:
> - Object A has a dependency on C1 and C2.
> - C1 and C2 both have a dependency on GC.
> - I need C1 and C2 to have the same GS in a given build up.
>
> Using StructureMap a single instance of GC is created and passed to
> both C1 and C2.
> Using Castle.Windsor a new instance of GC is created for C1 and C2 -
> ie 2 instances.
>
> In my case GS is managing a nHibernate session, and C1 and C2 are
> repositories used by domain class A.
>
> Castle Windsor is returning 2 sessions causing cross session data
> errors.
>
> Does anyone know how to get access to or use the build up context so
> the instances of child objects can be cached like structure map.
>
> Thanks,
>
> SB
>
> --
> You received this message because you are subscribed to the Google Groups
> "Castle Project Users" group.
> To post to this group, send email to [email protected]
> .
> To unsubscribe from this group, send email to
> [email protected]<castle-project-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/castle-project-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" 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/castle-project-users?hl=en.

Reply via email to