Saturday, December 4, 2010

NHibernate 3.0

NHibernate 3.0.GA has been released!  It has all sorts of goodies like QueryOver, logging abstraction, and tons more.  It also now has a built-in LINQ provider.  Unfortunately, the LINQ provider is still in a beta state.  Many queries work (as evidenced by the hundreds of working unit tests), but there are also still many queries it has trouble with.  If you'd like to help accelerate the development of the LINQ provider (or any other part of NH for that matter), here's what you can do:
  1. File issues when you find bugs.  http://jira.nhforge.org/
  2. Vote for issues.  Popularity is difficult to gauge if we don't hear back from people.
  3. Provide test cases for those issues.  A complete test case is easier to digest than a tiny code fragment without context.  If the test can be used directly, the team member working on the issue can spend more of their time making improvements instead of trying to recreate a test.
  4. If you're feeling ambitious, dig into the source code and try to work out a fix.
There's a great article on making tests for NHibernate here.  I've also included some different steps that might help you out.
  1. Check out the trunk using something like TortoiseSVN (https://nhibernate.svn.sourceforge.net/svnroot/nhibernate/trunk/nhibernate)
  2. Use ShowBuildMenu.bat to create the AssemblyInfo.cs files.
  3. Load up NHibernate.Everything.sln in Visual Studio.
  4. Create a test with the issue number in the NHSpecificTest folder of the NHibernate.Test project (NH2392 is a fairly simple example to copy from).
  5. Use ShowBuildMenu.bat to see how to set up your database connection and run all the tests.
  6. Create a patch (TortoiseSVN can help you with this) and attach it to the JIRA issue.
With your help, we will work towards a rock solid LINQ release that matches the tremendous power and reliability already provided by the NHibernate platform.

3 comments:

  1. I'm happy to see that someone admits that the LINQ provider is still in a beta state. I don't understand why NHibernate 3.0 has been released. The most important improvement in this release is the new LINQ provider. In my mind, with the LINQ provider in this state, the NHibernate 3.0 GA is a NHibernate 3.0 beta 3 !

    ReplyDelete
  2. I have also been really disappointed when I first run some queries with the new linq-provider, seeing the poor SQL it generates in NHProf. IMHO the provider is far from being production-ready in enterprise-environment.

    Simple CRUDs are fine, but when I need to have clear and readable SQL-output, I always "fall back" to QueryOver, which is currently the best way to go with NHibernate.

    ReplyDelete
  3. Hi d.lang. I'd be quite interested to know what aspects of the generated SQL you found particularly disturbing.

    We have made some improvements for the 3.1 version, which is being released imminently. Admittedly though, you aren't likely to see major differences in the query structure, so I am quite curious what the main problems you see are.

    ReplyDelete