Fluent Nhibernate and Nhibernate 2.1.0.1003 - nhibernate

Im experiencing some frustration trying to upgrade the nhibernate libraries that Fluent NHibernate uses.
Im also using Nhibernate.Linq and am wanting to use NHibernate.Validator, specifically the ValidationDef class.
Now Nhibernate.Validator is up to using Nhibernate 2.1.0.1003, and when i try to build FluentNhibernate against this verion it get some test errors.
It has to do with SessionFactory configuration and the newish Nhibernate.ByteCode.Castle library.
Could anyone help me out here?

I don't think FNH "officially" supports NHibernate 2.1 and probably won't until after it is actually released. However, it's my understanding that it is possible to get it to work. See if this thread on the FNH groups is helpful.

Related

Pre-generating proxies for NHibernate 3.x?

Is it possible to pre-generate lazy-loading proxies under NHibernate 3?
NHibernate 2 supported this via NHPG but NHPG hasn't been updated for NH3 that I can see. Downloading the NHPG sources and blindly changing the assembly reference from NH2 to NH3 blows up; NH3 has built-in proxy generation and stuff has been reorganized.
How are people (pre) generating lazy proxies under NH3?
I've updated NHPG to support NHibernate 3.3.1 GA.
You could grab the sources here: https://github.com/NHibernate-Contrib/NHibernate.ProxyGenerators
You have to build it by hands (download the sources and run package.cmd) for now until we release an official version.
I don't know if this answers your question since I do not see any tag related to language that you are using.
In .NET, I use Fluent NHibernate and POCO objects. Don't know if there is a tool to upgrade your XML files to POCO classes to use with Fluent NHibernate.

Solrnet, StructureMap and NHibernate

I'm having a problem integrating a library our company has built which uses Solrnet in the back end. We have many other libraries, one of which uses NHibernate for the database. It all works fine, the library gets the data back.
When we add a reference to this new library which uses Solrnet, things start to go arwy. The first error that occurs when we run the application. when the application runs the StructureMap registry for the library using NHibernate, the registry blows up because NHibernate can't load the Castle.Core assembly (which has not caused any problems being missing prior to adding the reference). If we then ensure that Castle.Core is present, NHibernate then blows up trying to load Castle.Windsor, which again it didn't need before.
Any ideas? As I said, the library which uses NHibernate is fine if we remove the new library which uses Solrnet, but as soon as we reference it things start to go wrong. The library which uses Solrnet also configures Solrnet using StructureMap, FWIW.
EDIT: These are the versions of various assemblies in the mix.
StructureMap - 2.6.1.0
Fluent NHibernate - 1.0.0.0
NHibernate - 2.1.2.4000
Solrnet - 0.3.1.0
Castle.Core (came with NH) - 1.1.0.0
UPDATE: Its starting to look like Solrnet is the one trying to load Castle.Windsor. I'm not sure why as we've given it a StructureMap configuartion. Its mere presence is enough to blow things up. Even without the assemblies which depend on Solrnet, the fact that its there at all seems to mess with the NHibernate configuration.
Ok, I figured out how to stop this error. We were using the merged Solrnet.dll, which includes all the types for connecting to other Ioc containers as well as NH integration. I switched to using the unmerged binaries, which keeps the other Iocs in separate assemblies, and we only included the base Solrnet.dll and StructureMap.Solrnet.dll, which solved the issues mostly. I still did have to be sure to include Microsoft.Patterns.ServiceLocater, as the base Solrnet.dll still exposes this. Not ideal as we're not using it, but better than needing a bunch of other assemblies.

NHibernate in Action book

I am searching for a good book on NHibernate and sorted out that 'NHibernate in Action' should be good for me.
I am currently working on a project that uses Fluent NHibernate but still would like to dive into how-it-works basics.
Wondering if there is any newer release of NHibernate in Action book other than which explains Version 1.2.
Any ideas?
Get a copy of the NHibernate 3.0 Cookbook

Interoperable Fluent NHibernate + NHibernate + Linq To NHibernate

I would like to get all 3 of these libraries working together but have a version problem.
Latest version of Linq To Hibernate (1.0) came out on 2009-07-26 and works with NHibernate 2.1.0 afaik. Fluent NHibernate's oldest release on the other hand is for NHibernate 2.1.2.
Google search yielded this zip file of binaries compiled together but it's somewhat outdated (2009-07-19). I'm not sure downloading the latest source code of each project and trying to build them together will work or not, I'd rather not to go that way unless I have to.
I guess the weakest link in this combination is Linq To NHibernate and maybe I should think of leaving it outside if there isn't an active community effort.
In short: Does anyone use these libraries together and if so, how did you solve this issue? Do you build it all yourself?
Note:
Looks like a duplicate of this question but it has been 1 year since it's answered, and the links given in the accepted answer don't work anymore.
NHibernate ver 3 has been released which already has the linq libraries. Download the latest binaries.
I don't think Fluent has been updated to use 3 yet so download the latest source for fluent and replace the NHibernate assemblies with the new NHibernate version 3 assemblies. You will need to tweak the source ever so slightly so that it compiles. Compile it in release mode and grab the output from the project bin folder.
It has been working fine for us.
EDIT
As Kohan pointed out you can download the latest version of Fluent 1.2 with the latest version of NHibernate 3 from the link to Fluent NHibernate I provided earlier.

Fluent NHibernate with NHibernate 3.0

With NHibernate 3 going GA today, I was wondering if I can upgrade a project that is using Fluent NHibernate. Can i simply swap out the 2.1 DLL for the 3.0 and have it work? - Or is there more to it than that?
I know there will be some work with the change in Linq syntax but i am not concerned with that, I just want to know if the DLLs are interchangeable for Fluent.
Many thanks,
Kohan
Addendum
The Fluent guys have done it themselves now:
http://fluentnhibernate.org/downloads
drlongnecker has built Fluent NHibernate for NHibernate 3.0GA. You can grab the source here.
Update: Fluent Nhibernate now officially builds pre-release binaries with NHibernate 3.0.
You need to build them together. Can wait for NuGet to be updated or you can build them yourself.
Or you can put assembly redirect