NHibernate 3 Beginners Guide published


I am very pleased to announce that my book NHibernate 3 Beginners Guide has finally been published. It is a wonderful feeling to finally have a book in my hands that cost me a couple of months of intense work. But I think the result is well worth it.

If you are interested in the book then there is also a free chapter available for download.

I was lucky to have Fabio Maulo and José F. Romaniello as my reviewer, the former being the lead of the NHibernate project and the latter an active contributor to the the project.

My goal for this book has been to provide an easy to follow introduction to NHibernate 3.x. The text covers NHibernate up to version 3.1 GA and even references some of the new features of NHibernate 3.2 GA. It was very important to me to not use a data centric approach but rather choose a model first approach.

In this regard this book is NOT just an updated version of NHibernate 2 Beginners Guide but rather a complete rewrite.

I also have paid attention to cover all foundational topics in a clear and concise way. In no way did I want to abandon the reader in the dust of uncertainty.

Let me provide you the list of chapters found in the book with a short introduction about the respective content of each chapter.

Chapter 1, First Look… explains what NHibernate is and why we would use it in an application that needs to access data in a relational database. The chapter also briefly presents what is new in NHibernate 3.x compared to the version 2.x and discusses how one can get this framework. Links to various sources providing documentation and help are presented.

Chapter 2, A First Complete Sample…walks through a simple yet complete sample where the core concepts of NHibernate and its usage are introduced.

Chapter 3, Creating a Model… discusses what a domain model is and what building blocks constitute such a model. In an exercise the reader creates a domain model for a simple ordering system.

Chapter 4, Defining the Database Schema…explains what a database schema is and describes in details the individual parts comprising such a schema. A schema for the ordering system is created in an exercise.

Chapter 5, Mapping the Model to the Database…teaches how to bridge the gap between the domain model and the database schema with the aid of some wiring. This chapter presents four distinct techniques how the model can be mapped to the underlying database or vice versa. It is also shown how we can use NHibernate to automatically create the database schema by leveraging the meta-information contained in the domain model.

Chapter 6, Sessions and Transactions…teaches how to create NHibernate sessions to communicate with the database and how to use transactions to group multiple tasks into one consistent operation which succeeds or fails as a whole.

Chapter 7, Testing, Profiling, Monitoring and Logging…introduces how to test and profile our system during development to make sure we deliver a reliable, robust and maintainable application. It also shows how an application can be monitored in a productive environment and how it can log any unexpected or faulty behavior.

Chapter 8, Configuration… explains how we can tell NHibernate which database to use, as well as provide it the necessary credentials to get access to the stored data. In addition to that many more settings for NHibernate to tweak and optimize the database access are explained in this chapter.

Chapter 9, Writing Queries… discusses the various means how we can easily and efficiently query data from the database to create meaningful reports on screen or on paper.

Chapter 10, Validating the data to persist…discusses why data collected by an application needs to be correct, complete and consistent. It shows how we can instrument NHibernate to achieve this goal through various validation techniques.

Chapter 11, Common Pitfalls – Things to avoid… as the last chapter of this book presents the most common errors developers can make when using NHibernate to write or read data to and from the database. Each such pitfall is discussed in details and possible solutions to overcome the problems are shown.

Related Articles:

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

About Gabriel Schenker

Gabriel N. Schenker started his career as a physicist. Following his passion and interest in stars and the universe he chose to write his Ph.D. thesis in astrophysics. Soon after this he dedicated all his time to his second passion, writing and architecting software. Gabriel has since been working for over 20 years as a consultant, software architect, trainer, and mentor mainly on the .NET platform. He is currently working as principal software architect at ClearMeasure Inc. in Austin, Texas. Gabriel is passionate about software development and tries to make the life of developers easier by providing guidelines and frameworks to reduce friction in the software development process. Gabriel is married and father of four children and during his spare time likes hiking in the mountains, cooking and reading.
This entry was posted in book, introduction, NHibernate, tutorial. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • Nolan Egly

    Congratulations on getting the book finished.  I know you’ve been putting a lot of effort into it.

  • http://profiles.google.com/phillip.haydon Phillip Haydon

    OH! I’ve been waiting for this! 

  • Pingback: NHibernate 3 Beginner’s Guide published « Jason Dentler()

  • http://josephvano.wordpress.com/ Joey Vano


  • José Romaniello

    Congratulations Gabriel has been a pleasure to review your hard work. I hope some day you can come to Argentina to visit me and Fabio! 

  • Pingback: NHibernate 3 Beginners Guide published - Ayende @ Rahien()

  • Jim

    I’ve always been interested in NHibernate. I think this book would be helpful. It would have been nice if the sample chapter had been about NHibernate instead of just regular C# model classes.

  • Bindiya Mansharamani

    Congrats Gabriel!! Its worth the effort. A nice read.

  • http://www.facebook.com/people/Eric-Anderson/568001109 Eric Anderson

    I just cracked open this book. It’s so full of grammatical, structural and punctuation errors, it’s not even funny. It’s like there was NO proofreading at all. Looks like a really rushed job. Of course, this makes me wonder how many technical errors there are.

    • Anonymous

      @Eric: I would appreciate if you could give some samples which support your criticism. Please bear in mind that I am not a native English speaker and thus some imperfection can be expected. The book has been reviewed by different people and none of them ever complained about the text as you do. And please do not just judge the whole book just from skimming over some of the text. The technical correctness of the book has been verified by NHibernate’s project leader and one of its main contributors.

    • Kroknoster

       @facebook-568001109:disqus :Are we talking about the same book?  I’m going through it now (halfway) and learning tons.
      @gabrielschenker:disqus : Great book dude, thanks!

  • Question

    Is caching covered anywhere? Quite an important topic in my opinion.

    • Anonymous

      Caching is covered and the concepts of 1st and 2nd level cache are covered, but keep in mind that this is a beginner’s guide and thus the text does not or only partially cover some of the advanced topics.

  • Pingback: Review: NHibernate 3 Beginner’s Guide « Jason Dentler()

  • Vervidian

    which i can buy this book , i need it , give me  a  path or websit   address  then i can pay for money.  my email is vervidian@gmail.com. thx so much.

  • Vervidian

    which i can buy this book , i need it , give me  a  path or websit   address  then i can pay for money.  my email is vervidian@gmail.com. thx so much.