Author: steve.ebersole(a)jboss.com
Date: 2009-06-10 14:33:44 -0400 (Wed, 10 Jun 2009)
New Revision: 16744
Modified:
core/trunk/documentation/manual/src/main/docbook/en-US/content/transactions.xml
Log:
added a definition of UoW
Modified: core/trunk/documentation/manual/src/main/docbook/en-US/content/transactions.xml
===================================================================
---
core/trunk/documentation/manual/src/main/docbook/en-US/content/transactions.xml 2009-06-10
18:21:29 UTC (rev 16743)
+++
core/trunk/documentation/manual/src/main/docbook/en-US/content/transactions.xml 2009-06-10
18:33:44 UTC (rev 16744)
@@ -92,6 +92,23 @@
<title>Unit of work</title>
<para>
+ First, let's define a unit of work. A unit of work is a
+ design pattern described by Martin Fowler as
+ <quote>
+ [maintaining] a list of objects affected by a business
+ transaction and coordinates the writing out of changes
+ and the resolution of concurrency problems.
+ </quote><citation>PoEAA</citation>
+ In other words, its a series of operations we wish to carry out
+ against the database together. Basically, it is a transaction,
+ though fulfilling a unit of work will often span multiple
+ physical database transactions (see <xref
linkend="transactions-basics-apptx"/>).
+ So really we are talking about a more abstract notion of a
+ transaction. The term "business transaction" is also
sometimes
+ used in lieu of unit of work.
+ </para>
+
+ <para>
Do not use the <emphasis>session-per-operation</emphasis>
antipattern:
do not open and close a <literal>Session</literal> for every
simple database call in
a single thread. The same is true for database transactions. Database
calls
Show replies by date