Tuesday, March 15, 2011

Linq + NHibernate: is it production ready?

Is Linq + NHibernate production ready? I hear many folks using it in production code but it is still officialy 'Alpha'. It has been a long time, however, so what's your experience?

From stackoverflow
  • I'm using it, but I'm still falling back to the criteria API. It is production ready as long as you write integration tests for it. Some parts are even better the MS Linq2Sql others are not finished yet.

  • I haven't tried the current implementation but I heard official LINQ support will come with NHibernate 2.1, so I'd wait for that if you want to avoid any rough edges...

    Bevan : NHibernate 2.1.0 was released in July 2009 (http://sourceforge.net/projects/nhibernate/files/NHibernate/2.1.0.GA/NHibernate-2.1.0.GA-bin.zip/download). Update 2.1.2 was released in November 2009 (http://sourceforge.net/projects/nhibernate/files/NHibernate/2.1.2GA/NHibernate-2.1.2.GA-src.zip/download). Both releases include support for LINQ.
  • I seem to remember reading that it's usable for some of the more simple usages but in advanced situations it is still incomplete or green.

    As to whether it is production usable, I'd have to say it depends. For some people they are happy to work with early alpha version of software, for others any sort of open source software, no matter how mature is a step too far.

    It's up to you to draw the line where you see fit. Ask yourself how critical is the site? How would downtime affect the business. What is the worst case senario if an error does occur?

    If you are creating a blog for yourself and a few others to read, I'd suggest it is production ready. If you are lauching a new business critical site, were an hours down time could cost thousands, then maybe hold of a while longer.

  • We're using it here but behind a repository interface so that if LINQ to NHibernate doesn't quite fit the bill in some situations we can fall back on HQL or the criteria API when appropriate. So far we've found simple CRUD is fine but have fallen back to HQL for some more complicated things.

  • Yes the Linq for NHibernate will be re-write, I've hit a problem on the SelectMany operator and if you read Fabio last answer here http://xrl.us/befztp (Link to groups.google.com) you'lle see that the current implementation is based on Criteria.

0 comments:

Post a Comment