New Poll: What’s Keeping You From Using NHibernate?
Posted by Davy Brion on January 25th, 2009
I’m obviously biased, but i think that NHibernate is the best option for data access in the .NET world at the moment. And while we have a lot of users, there’s also a lot of people that don’t use it. I’m just curious as to why some people aren’t using it. So i’ve set up a new poll with some options you can select if you’re not using it. But if you’re not using it, do me a favor and leave a comment to explain your selection.
This isn’t meant to start a flamewar or anything like that, i’m just genuinely interested in reasons for not using NHibernate.
The options of the poll are:
- Tried it, just didn’t like it
- Tried it, but had problems that prevented me from using it
- Can’t try it because i have little to no faith in the project
- Can’t try it because i’m not allowed to use it (because of management, technical leads, legal reasons, etc…)
- Won’t try it because i use something else that i’m perfectly happy with
- Won’t try it because i’ve heard too many stories of projects having problems with it
Also, if there’s another reason why you’re not using it, please do share

January 25th, 2009 at 11:57 pm
Can’t try it. LGPL is seen as evil. If it was BSD or Apache 2, I’d be able to work it in.
January 26th, 2009 at 3:17 am
LGPL evil? Clearly no legal expertise then.
NHibernate is my 1st and only data-access choice for .NET development.
January 26th, 2009 at 4:30 am
I voted for it, but I didn’t like the wording of “Won’t try it because i use something else that i’m perfectly happy with”. It’s not that I wouldn’t try it, it’s that I haven’t tried it. As soon as I run into a problem that I can better solve with NHibernate than I’d be willing to make the switch. But so far my current solution seems to do all that I need at the moment.
January 26th, 2009 at 4:34 am
Of course now that I made the last post, I read your post yesterday discussing the Future batching capabilities within NHibernate, which I think is a pretty cool feature I’ve not seen. So, I guess I have no good reason for not using NHibernate besides wanting to use a consistent tool perhaps?
January 26th, 2009 at 7:53 am
Good documentation. We will probably move to nHIbenrante later, but the biggest problem is in my opinion documentation. For example, where can I find documentation for version 2.0?
January 26th, 2009 at 8:23 am
personally i love nhibernate, but some time ago at the local .Net user group we`ve talked about ORMs in the .NET world and they didn’t event mention NHibernate.I was told that the lack of visual designers would prohibit them from using ist.
this may be a reason for “ORM-starters”
January 26th, 2009 at 8:30 am
@Milan
yeah the documentation is indeed a problem right now… while most of the documentation for 1.2 is still accurate, the 2.0 specifics haven’t been documented properly yet
@Joachim
personally, i don’t like visual designers at all but i can see why the lack of it would put some people off, especially beginners.
having said that, i do believe that the manual mapping approach is much more productive in the long term than any visual designer could be
January 26th, 2009 at 10:09 am
You forgot the keep meaning to have a go but haven’t had a project that calls for it (and without setting up a replace the existing data access entirely layer project) yet option…
January 26th, 2009 at 10:14 am
I tried it just before starting a critical new project, and hit a few problems that the docs didn’t help me solve. I decided to fall back on LINQ-to-SQL with the intention of reevaluating NHibernate if (when) we hit blocking scenarios with LINQ-to-SQL.
January 26th, 2009 at 10:19 am
Im a big fan for NHibernate and use it for my own personal development. But even though some in my team recognise it as being a useful data layer, its the msdn syndrome that Scott Belware talked about recently. “Its just not a Microsoft product, so it cant be the right strategy” attitude.
Plus the unfortunate attitude we live in still that everything data related should be extracted using stored procedures and datasets.
January 26th, 2009 at 10:29 am
Somewhere between the first two options I suppose!
In the project I’m working on we use immutable DTO objects to move data from the DB to the domain. All the properties and private fields are read only so they can only be setup through their constructor. I couldn’t seem to find a way to get this to work with NH. As far as I could tell from the docs and my own spike I had to add a default constructor and make the fields writeable – not really a probem, but hardly persistance ignorance.
Having said that we’re about to start a new project, and I’m very keen to use an ORM right from the start
January 26th, 2009 at 11:18 am
I develop winforms apps. I can’t find a definitive source which clearly explains how should I design my classes to use the ISession object or the Unit of Work concept. I’ve found some guidance on forums though.
January 26th, 2009 at 1:02 pm
I’m waiting for linq support. ( and documentation )
January 26th, 2009 at 1:28 pm
We’ve got a data access approach, which uses code generation and some stored procs. It works ok but not great – e.g poor separtion of concerns, no lazy loading.
But its very hard to see how to migrate from this to NHibernate. (esp. because have no experience with NHibernate).
A big help would be a good technology independent data access architecture, we could migrate to first. Then replace our current stuff with NHibernate second.
January 26th, 2009 at 2:20 pm
I use SubSonic instead:
– UPDATEs only save changed fields back to disk as opposed to NH’s all fields.
– supports VB.NET better
January 26th, 2009 at 2:56 pm
I’m actually the last 2:
- Won’t try it because i use something else that i’m perfectly happy with
- Won’t try it because i’ve heard too many stories of projects having problems with it
I do watch to see if there is something better. I’m always evaluating. Your PR and my experience is that NHibernate is hard to set up; when your project has to have lot’s of tutorials none of which actually satisfy the problems of a newbie learning to use your project…
Also, I love the simplicity of setting up SubSonic (my personal choice).
January 26th, 2009 at 3:31 pm
I’m trying to use nHibernate now. The two biggest pain points for me are…
1. Lack of good documentation. This means both in-depth documentation of everything, but mostly getting started docs. Things like step by step setup, examples, and best practices all located in one place.
2. Lack of up to date, easy to use code gen templates (T4 / CodeSmith / MyGeneration / etc)
January 26th, 2009 at 3:58 pm
It seems almost as though NHibernate doesn’t want me to learn it. I’ve downloaded it and tried a few times, but whenever I find what looks like a good “From scratch” tutorial it seems that it must be based on an older version or something because I always experience a problem that stops it from working.
I currently use ECO from CapableObjects which does all that I want, and has getting started docs too (I wrote them), but it’s always good to learn as much as you can from as many sources as possible so I have recently decided to “bite the bullet” and buy NHibernate in Action. Once I have read that book I will finally make an informed decision rather than the uninformed one I have made to date.
The lack of docs though is just an absolute killer for me. I don’t have enough free time to learn something before discovering if it is any good or not, I need to skim over docs and judge before I dedicate the time.
January 26th, 2009 at 10:44 pm
I think lack of time and heard it’s complicated and hard to start makes me don’t want to try it.
I definitely learned that it’s a feature-packed ORM, but the first wall of getting what it is and how you can start is hindering me that doesn’t much time and motivation to try it.
January 26th, 2009 at 11:27 pm
Can’t use it for current client as the perm devs won’t invest any time in learning it (or any ORM)
January 27th, 2009 at 6:30 pm
From my experience of using NHibernate, it’s a development approach that requires a non-trivial grasp of several disciplines which the typical corporate developer has not been trained in. You will probably need an understanding of:
1. Aggregation/Composition
2. Polymorphism
3. Entity-relationship modelling/normalisation
NHibernate forces you to think of the problem in terms of objects which is a great departure from what you normally see in the field where domains are perceived in a procedural style.
You do need an NHibernate champion on the team.
Other practical considerations are:
1. Effort of mapping the domain. It’s ok to look at an example, but then most application scenarios go beyond the example. There is the Fluent approach to mapping, but this appears to a non-core feature. Then there is NHibernate Mapping Attributes which has it’s own issues.
2.The documentation available seems to have a Hibernate-esque feel to it; if you are from a Java background then no probs. Otherwise this can be a hindrance.
3. The stack traces tend to be somewhat non-informative, which can be painful when your app has blown up.
4. Tool support- it’s great to have an NHibernate Profiler but I would expect to at least have a free version of the tool. I now have to resort to using the SQL Profiler to view what’s going on in the background. I can use the Show SQL option. I guess making tools costly raises the barriers to entry in the NHibernate game.
January 29th, 2009 at 2:38 pm
I tried i even modified the sources a bit to fit my needs but:
1) problems in 3tier scenarios: i have to attach the entity on the server, load the data again from db to get the changes or save all properties (yuck).
2) misleading API. I do not like apis that do not do what their name says:
GetById() = look in the cache first and than in the db (yuck) depending on the configuration.
I would preffer: GetById(x, Options.UseCache); that overrides any configuration
It does not know how to map interfaces not classes
and so on…
it is a very good ORM if you want to have a surprise every day.
August 19th, 2009 at 5:14 pm
#5
I believe that LLBLGenPro is a, albiet not free, superior product when it comes to support and documentation. The whole idea is knocking out a data access layer with a few clicks is important to me. I don’t want to spend most of my time setting up all the config files. LLBLGenPro has a nice GUI that allows you to do all of the configuration in an intuitive manner.