O'Reilly logo

NHibernate 3 Beginner's Guide by Gabriel N. Schenker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using implicit transactions

It is highly recommended practice to always wrap database operations into explicit transactions when using NHibernate. If we do not explicitly define the boundaries of our transactions, then the database uses implicit transactions to wrap each single statement. In most scenarios, this is inefficient as we usually execute multiple statements inside a business transaction of our system. As the boundaries of a business transaction are defined by the feature we implement, we should always make this explicit by opening and closing a transaction at the appropriate location. The simplest form in doing so is to begin a transaction immediately after opening a session, and to end and commit the transaction immediately before ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required