I fail to see the problem really. FluentlyConfigure returns a fluent configuration if you call BuildConfiguration(); that returns an Nhibernate Configuration. Why can't you work with that before BuildSessionFactory? At this point Fluently does not do anything it just passes on the Configuration and the SessionFactory to NHibernate. It's a great architecture from a customization point of view but maybe not the easiest to follow. I'll try to explain a bit further. For me to enable storing Xml as SqlDbType.Xml in MS SQL server I only had to add a couple of properties to NHibernate source code (DbType.Xml) in the dialect file. Then I created a IUserType that I set from the fluent configuration hosted in my private project not in NHibernate and it works like a charm. You should definitely be able to accomplish what you want with the Interceptor. Just leave the SessionSource to it's destiny (to be deleted?) and work with the SessionFactory directly and you should be fine.
-"Stop thinking it On Wed, Sep 2, 2009 at 9:27 PM, Joseph LeBlanc <[email protected]>wrote: > > Upon further inspection simply exposing access to the SessionFactory > alone isn't enough because once the factory has been created it's too > late to set the interceptor on the fluent config object (using the > ExposeConfiguration method). > > Unfortunately the configuration property SessionSource accesses is > marked "internal" so I can't duplicate SessionSource's functionality > in my own library. > > I think making the SessionFactory public and adding an IInterceptor > property are the way to go and then change the CreateSession() method > to this: > > public virtual ISession CreateSession() > { > if (this.interceptor == null) > return sessionFactory.OpenSession(); > else > return sessionFactory.OpenSession(this.interceptor); > } > > Unless there is another way to register an Interceptor with fluent- > nhibernate that I'm overlooking? > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" 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/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---
