Thursday, May 30, 2013

What's planned for NHibernate 4?

Yesterday Ricardo Peres wrote an article about the state of NHibernate development, comparing it to Entity Framework and noticing that NHibernate's future doesn't look bright. It's pretty much in line with what I meant asking if NHibernate is already dead few months ago. But, as I'm still actively using NHibernate in my project and there are no prospects of changing that, it would be nice if that's not the case.

Although there's no clear roadmap available, it seems that NHibernate's community is planning a major release, bumping the version number to 4. The reason for that is pretty simple - the product is going to switch from .NET 3.5 to 4, mostly to retire Iesi.Collections dependency that provided set implementations that are now partially available in the BCL. This is a major breaking change and that justifies changing the major version number, for sure. Some obsoletes will be cleaned up in the same time.

Are there any new features planned for 4.0? Well, there are some, but I can't say the list is impressive. SQL Server 2012 will be supported better (sequences, limit feature), Ingres9 will be also supported out of the box and few other dialects will have some improvements. But, let's admit it, this is not a big deal for existing users. There are of couse several bugfixes and minor improvements done and planned for that version, i.e. in Linq provider (NH-3186, NH-2852, NH-3056, NH-2915, NH-3256), in mapping-by-code (NH-3280, NH-3313). There is also one possibly significant performance improvement with Linq queries done.

The draft version of release notes is available as a reference for all JIRA issues already resolved. Unfortunately, I can see no "flag ship" feature that might interest, majority of the list is rather maintenance of existing features or cleanup. Definitely not enough to encourage more interest in NHibernate, leaving the framework targeting breaking change the only thing that really justifies releasing this as 4.0 and not as 3.4.

And to make things clear, I'm not complaining that current contributors are lazy. I think Hazzik and Oskar Berggren are doing fantastic job keeping things up and running. The problem is that they are the only really active members of the community. And the size and complexity of the project is big enough to make gaining new contributors really hard, for sure. I've tried to fix one bug once - and I failed.

Anyway, my fingers are crossed in hope of new great features in NHibernate, but, looking objectively, I don't expect anything like that to happen.


  1. a new driver for the oracle managed driver is what i'm waiting for.

    1. You can already use Oracle Managed Driver with NHibernate 3 using custom NHibernate driver like this:

  2. IMHO, NHibernate development became too expensive. It would probably be a very good idea to fork it and remove all these possibilities to do something in five different ways. The remaining stuff could than be really good. I mean: one way to map (e.g. by code) one way to query (e.g. by linq). It could be made simpler to use and more transparent be sacrificing the implicit proxies, which tend to be not as transparent that one can write code without care. Cleaner user types. Cleaner events / interceptor interface. I think NH could be almost as simple as other ORMs and still much more powerful.

  3. Too bad. NHibernate was and is the #1 tool used in my toolchain. No ORM to date provides 1/10s of it's abilities. Well, looks like I just have to wait till EF catches up and migrate. Very sad though. :(

  4. Part of the problem is that when programmers new comers look for solution to problems they find much more examples and tutorial today using Entity Framework than NHibernate. The same happened in the Dataset gold era, only few of us decided to walk the hard road when Nhibernate was almost the only complete ORM solution for .NET world and the vast majority fell under the temptation of smooth start that Datasets offered. As time passed and programmers matured and DDD landed the sight turned to ORMs ... and also Microsoft did it too. In that time NH get his peak as EF was a baby in that days and to be fair it has grow considerably.
    So, we need to produce much more updated examples and tutorials for NHibernate to attract programmers/users and contributors.

  5. Elio Batista is absolutely right. I advocated NHibernate for sooo many years and I still face issues during my talks with people that never ever worked with a real ORM but truly believe that EF or the evilish Dataset is the way to go.
    We should show more complex articles and posts about the powerful functionalities of Nhb.
    Actually I am working on an evilish legacy database and I would not even imagine how I could achieve what I am achieving with a tool different than NHibernate.
    Kudo to the team and I am considering to jump back to contribute to the project too!