Mar 31 2008

NHibernate 2.0 Alpha

Tag: NHibernateSymon Rottem @ 10:41 pm

For those of you who aren’t already in the know, the new version of NHibernate has entered it’s alpha release stage. This brings the codebase almost into line with the current Java Hibernate release (3.2) with a couple of exceptions so this is definitely something to write home about.

A few of the key things that I’ve been waiting for in this release are:

  • Inspection/traversal, modification and cloning of ICriteria
  • Table per subclass mapping with a discriminator
  • MultiCriteria
  • Mapping of one class to several tables using the <join> mapping.
  • Events and listeners

The changelog goes some of the way to explain the new changes in more detail than I have, but there’s a more comprehensive rundown on Ayende’s blog if you want a little more meat to chew on. In addition, Fabio Maulo (one of the NHibernate developers) noted that there are a couple of additional features that are notably missing from the changelog; namely the Merge and Persist methods on ISession and extended cascade mappings, unionsubclass and on-delete on the mapping side.

In reality you do need to take some care before upgrading since this is an alpha, but you can rest assured that the code is not brand spanking new, untested and unused. As Ayende mentions in his blog post…

We call this alpha, but many of us are using this in production, so we are really certain in its stability.

Anway, the call is out to start playing with the new version so the developers can get some real-world feedback on how it’s working in your environment and a chance to fix any issues before they give it their blessing for use in more critical and widespread environments. The Castle trunk has been updated to use this new release, so it can’t be too bad now, can it?

If you do decide to upgrade there are some breaking changes to be aware of, but most of them shouldn’t cause you major problems unless you’ve decided to bend and twist NHibernate more that the average user.

Also worthy of note is that there don’t appear to be updated docs available yet, but since most of the features of the new version match those of the production Java version their docs should help you get a good idea of where you are going.

You can keep up with what’s going on with others who are using the new version, get help and can provide feedback on the new NHibernate mailing list as well as the forums. At the moment the mailing list is very active so it’s a great alternative to the forums if you don’t get any response there.

I’ll be taking the new NHibernate for a whirl myself very shortly and will post on my experiences as they happen.