Unfortuantely I was dead wrong. Even if I try to run it in the constructor of PersistenceConfiguration.cs it doesn't stick even though I added references etc to it. My take right now is that NHibernate somehow changed how this ByteCode provider is stored!!
I'll get Ayende for this one! 2009/7/11 Mikael Henriksson <[email protected]> > Aaaah but now I get it. I have to add this fucker: > ProxyFactoryFactory("NHibernate.ByteCode.Castle.ProxyFactoryFactory, > NHibernate.ByteCode.Castle"); to every dialect available to get it to work. > Well don't really need it for all of them but what is needed is to be able > to set this from the configuration pretty much any time I want. I don't want > to have to do this by rebuilding Fluent... Am I right? Left? > > 2009/7/11 James Gregory <[email protected]> > > There's a ProxyFactoryFactory method inside the Database method. Not sure >> what it's doing in there really, but it works. >> >> >> On Sat, Jul 11, 2009 at 6:43 AM, Mikael Henriksson >> <[email protected]>wrote: >> >>> That's the first thing I did but I got stuck on the proxy thing. Inside >>> PersistenceConfiguration.cs I tried to hard code: >>> public TThisConfiguration ProxyFactoryFactory(string >>> proxyFactoryFactoryClass) >>> { >>> values.Store(ProxyFactoryFactoryClassKey, >>> proxyFactoryFactoryClass); >>> return (TThisConfiguration)this; >>> } >>> but I can't see it being called anywhere and it seems to be needed in >>> the next version of NHibernate. My take is that it simply is not implemented >>> yet and I am not sure where to start digging. Bear with me I only played >>> around with this for a couple of days totally. >>> >>> >>> 2009/7/11 Hudson Akridge <[email protected]> >>> >>>> I believe, if you want, you just have to change the SchemaExport line >>>> to: >>>> .Execute(script, true, false, session.Connection, null); >>>> >>>> That should work for NH 2.1+ >>>> >>>> >>>> On Sat, Jul 11, 2009 at 12:20 AM, Mikael Henriksson < >>>> [email protected]> wrote: >>>> >>>>> No worries :) I don't mind waiting. Have lot's of code to write before >>>>> I have to worry about that and besides. When Validator get's it's hooks in >>>>> my project I should be able to do a simple: >>>>> new SchemaUpdate(config).Execute(true, true); to refresh the schema. >>>>> >>>>> >>>>> 2009/7/11 Hudson Akridge <[email protected]> >>>>> >>>>>> Ah right, I apologize, I forgot about that. NH2.1 changes the schema >>>>>> export as well as the proxy factory stuff ;) We'll be upgrading to that >>>>>> before too long here I'd imagine. >>>>>> >>>>>> >>>>>> On Fri, Jul 10, 2009 at 10:23 PM, Mikael Henriksson < >>>>>> [email protected]> wrote: >>>>>> >>>>>>> There seems to be a problem with SessionSource.cs: >>>>>>> >>>>>>> public void BuildSchema(ISession session, bool script) >>>>>>> { >>>>>>> new SchemaExport(configuration) >>>>>>> .Execute(script, true, false, true, >>>>>>> session.Connection, null); >>>>>>> } >>>>>>> >>>>>>> For some reason the last true just before the session.Connection >>>>>>> should not be there anymore and honestly I am not too confident with >>>>>>> NHibernate and Fluent to play around with it too much. I'll just end up >>>>>>> breaking things. :) I suppose you guys are dead busy with stuff and I >>>>>>> understand that you might want to wait for the final release of >>>>>>> NHibernate. >>>>>>> I think Validator is going to upgrade to that version too later on but >>>>>>> if >>>>>>> someone would have a quick look at it that would be fantastic. >>>>>>> >>>>>>> Cheers >>>>>>> >>>>>>> >>>>>>> 2009/7/11 Hudson Akridge <[email protected]> >>>>>>> >>>>>>>> So if you've got that specified in your hibernate.config.xml file, >>>>>>>> as if you were using NHibernate without FNH, you'd build your >>>>>>>> configuration >>>>>>>> object like you would without FNH. >>>>>>>> Then pass that to: >>>>>>>> Fluently.Configure(nhibernateConfig).etc(); >>>>>>>> >>>>>>>> and when you call .BuildSessionFactory() it should pick up on that. >>>>>>>> You could also do a >>>>>>>> .ExposeConfiguration(x=>x.AddProperties(yourProps)) as >>>>>>>> well I believe, but I personally find it easier to go with the passing >>>>>>>> in a >>>>>>>> NHibernate Configuration (which picks up on the hibernate.config.xml >>>>>>>> automatically) to the Fluent configure. >>>>>>>> >>>>>>>> There might also be another way to do this that I'm not aware of :) >>>>>>>> >>>>>>>> >>>>>>>> On Fri, Jul 10, 2009 at 9:36 PM, Mikael Henriksson < >>>>>>>> [email protected]> wrote: >>>>>>>> >>>>>>>>> I tried both of them. Where is this sent from Fluent to NHibernate? >>>>>>>>> I'll just hardcode it for now. >>>>>>>>> >>>>>>>>> 2009/7/11 Hudson Akridge <[email protected]> >>>>>>>>> >>>>>>>>>> If you rebuilt FNH with the latest version of NHibernate, you may >>>>>>>>>> need to include a hibernate.cfg.xml file with your application that >>>>>>>>>> has the >>>>>>>>>> proxyfactory.factory_class registered with either castle or LinFu >>>>>>>>>> (doesn't >>>>>>>>>> really matter which), then pass that to the fluent configuration >>>>>>>>>> before you >>>>>>>>>> attempt to build a session factory. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Fri, Jul 10, 2009 at 9:16 PM, Mikael Henriksson < >>>>>>>>>> [email protected]> wrote: >>>>>>>>>> >>>>>>>>>>> Hi, >>>>>>>>>>> >>>>>>>>>>> I was because of need to use NHibernate Validator updating the >>>>>>>>>>> NHibernate version to the latest 2.1.3 or something like that. Now >>>>>>>>>>> I get an >>>>>>>>>>> exception saying: >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> NHibernate.Bytecode.ProxyFactoryFactoryNotConfiguredException: The >>>>>>>>>>> ProxyFactoryFactory was not configured. >>>>>>>>>>> >>>>>>>>>>> Initialize 'proxyfactory.factory_class' property of the >>>>>>>>>>> session-factory configuration section with one of the available >>>>>>>>>>> NHibernate.ByteCode providers. >>>>>>>>>>> Example: >>>>>>>>>>> >>>>>>>>>>> <property >>>>>>>>>>> name='proxyfactory.factory_class'>NHibernate.ByteCode.LinFu.ProxyFactoryFactory, >>>>>>>>>>> NHibernate.ByteCode.LinFu</property> >>>>>>>>>>> Example: >>>>>>>>>>> >>>>>>>>>>> <property >>>>>>>>>>> name='proxyfactory.factory_class'>NHibernate.ByteCode.Castle.ProxyFactoryFactory, >>>>>>>>>>> NHibernate.ByteCode.Castle</property> >>>>>>>>>>> >>>>>>>>>>> What do I need to do to make it work? >>>>>>>>>>> >>>>>>>>>>> Cheers! :) >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> - Hudson >>>>>>>>>> http://www.bestguesstheory.com >>>>>>>>>> http://twitter.com/HudsonAkridge >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> - Hudson >>>>>>>> http://www.bestguesstheory.com >>>>>>>> http://twitter.com/HudsonAkridge >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> - Hudson >>>>>> http://www.bestguesstheory.com >>>>>> http://twitter.com/HudsonAkridge >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> - Hudson >>>> http://www.bestguesstheory.com >>>> http://twitter.com/HudsonAkridge >>>> >>>> >>>> >>> >>> >>> >> >> >> >> > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
