You typically would have something above the ISessionFactory anyway to provide the session-per-request pattern needed for web applications (assuming this is a web app)
Have you looked at NHibernate.Burrow in the contrib project for stuff like this? Paul On Apr 8, 12:52 am, Germán Schuager <[email protected]> wrote: > http://castleproject.org/container/facilities/trunk/nhibernate/index.... > You can just inject ISessionFactory in your data access classes. > > And I think that configuring Windsor correctly you can specify which > ISessionFactory is injected in which DAO. > > > > On Tue, Apr 7, 2009 at 6:27 PM, rg <[email protected]> wrote: > > > Hi, I'd like to use Castle Windsor (yes, I'm a newbie) in an already > > existing project, but don't want to introduce any dependencies on > > castle in my components. And I have a problem with NHibernate. Castle > > framework has a NHibernate 'facility' that uses ISessionManager > > interface for opening database sessions. Can I somehow use old > > ISessionFactory as defined in NHibernate? How can Castle be used to > > inject a proper ISessionFactory to my classes? Is it possible at all, > > or am I forced to use ISessionManager? > > And how about using multiple databases? With nhibernate or spring.net > > I could configure several ISessionFactories, one for each database, > > and inject them to appropriate components. With Castle Windsor I'm > > expected to use singie ISessionManager and give each database an > > alias. So effectively I have to inject two parameters - > > ISessionManager and database alias. Why such design? > > My goal is to have reusable components, not tied to particular IoC > > container so they can be used with Castle, Spring.net or Unity. Please > > help me deal with NHibernate in such case. > > Thanks > > Rafal- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
