What is the meaning of "Unit of Work" concept in NHibernate and other ORMs?
What is the meaning of "Unit of Work" concept 开发者_Go百科in NHibernate and other ORMs?
It is explained very well in this blog post.
"A Unit of Work keeps track of everything you do during a business transaction that can affect the database. When you're done, it figures out everything that needs to be done to alter the database as a result of your work."
A unit of work is one or more database transactions that are either commited or rolled back together: either all succeed or all fail. It's the idea of ACID properties for databases.
精彩评论