views:

173

answers:

1

I can't seem to find any information on what the actual differences are between nhibernate 1.2 and 2.0. I have found information regarding what the potential issues are with upgrading, but nothing on what new features are included, or anything about performance differences.

If there are significant differences between the two that could make our development more efficient or easier then I would like to recommend an upgrade to my supervisor. If there isn't anything in there worth messing with then I can't see a point in trying to upgrade a currently stable library.

I was going to post links to the information I have already reviewed, but I'm not allowed to as I'm considered a new user.

+4  A: 

I spent 6 months conning my work into an upgrade. Let me simply state some of the benefits we noticed, so that you may show the powers that be:

  • Session start up time was dramatically reduced. This is the amount of time it takes for the SessionFactory to initialize on startup. Time was ~45 sec, and now is ~5 sec. Not so much an issue for production, but definitely a hassle for dev. Keep in mind we have roughly 200 domain objects.
  • We took advantage of lazy loading (and I don't mean collections, but classes) on upgrade which is the default. That is a change from 1.2 to 2.0. But we did run into issues with objects that weren't fully loaded that were disconnected from session. Those weren't easy to find, but easy to solve.
  • We took advantage of batching, which I think was new. That had some big improvements on bulk update operations, which NH isn't really intended for.
  • With the 2 improvements above, we saw a time reduction for specific nightly operations by 30%.
  • One of our biggest complaints about the old framework, is that it became difficult to find support and current information for 1.2.
  • There is improved Criteria Query support for things like paging and counts. Criteria Queries are nice, because they leverage 1st level cache.
  • Strongly typed collections are quite pleasant to work with. We enjoy occasionally using LINQ, instead of complex SQL, on domain objects and having strongly typed collections is a must for that.
  • We use also use Ayende's profiler, currently built for 2.0+
  • There are others, but in summary our migration experience wasn't nearly as scary as we thought. And we have some legacy stuff that would make NH folks shudder. You'll need to change your config settings, upgrade some deprecated interfaces (I think we had less than 30 in our solution), but the biggest pain is making all properties/methods of your domain objects virtual. I actually wrote a quick program to comb through our domain objects and do this since we had so many.
Trent