Author: wyoung
Date: Sat Mar 18 06:07:05 2006
New Revision: 1262
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1262&view=rev
Log:
Documented Transaction class
Modified:
branches/v2.1-bakefile/doc/userman/Makefile
branches/v2.1-bakefile/doc/userman/userman.xml
branches/v2.1-bakefile/lib/transaction.h
Modified: branches/v2.1-bakefile/doc/userman/Makefile
URL:
http://svn.gna.org/viewcvs/mysqlpp/branches/v2.1-bakefile/doc/userman/Makefile?rev=1262&r1=1261&r2=1262&view=diff
==============================================================================
--- branches/v2.1-bakefile/doc/userman/Makefile (original)
+++ branches/v2.1-bakefile/doc/userman/Makefile Sat Mar 18 06:07:05 2006
@@ -19,7 +19,7 @@
EX_TXT=cgi_image.txt custom1.txt custom2.txt custom3.txt custom4.txt \
custom5.txt custom6.txt fieldinf1.txt load_file.txt \
resetdb.txt simple1.txt simple2.txt simple3.txt stock.txt \
- updel.txt util.txt
+ updel.txt util.txt xaction.txt
## ------------------------
Modified: branches/v2.1-bakefile/doc/userman/userman.xml
URL:
http://svn.gna.org/viewcvs/mysqlpp/branches/v2.1-bakefile/doc/userman/userman.xml?rev=1262&r1=1261&r2=1262&view=diff
==============================================================================
--- branches/v2.1-bakefile/doc/userman/userman.xml (original)
+++ branches/v2.1-bakefile/doc/userman/userman.xml Sat Mar 18 06:07:05 2006
@@ -827,6 +827,34 @@
printed "(NULL)", and the second would have thrown
a <computeroutput>BadNullConversion</computeroutput>
exception.</para>
+ </sect2>
+
+
+ <sect2>
+ <title>Creating Transaction Sets</title>
+
+ <para>MySQL++ v2.1 added the <ulink type="classref"
+ url="Transaction"/> class, which makes it easier to
+ use transactions in an exception-safe manner. Normally
+ you create the <classname>Transaction</classname>
+ object on the stack before you issue the queries in
+ your transaction set. Then, when all the queries
+ in the transaction set have been issued, you call
+ <function>Transaction::commit()</function>,
+ which commits the transaction set. If the
+ <classname>Transaction</classname> object goes out of
+ scope before you call <function>commit()</function>,
+ the transaction set is rolled back. This ensures
+ that if some code throws an exception after the
+ transaction is started but before it is committed,
+ the transaction isn't left unresolved.</para>
+
+ <para><filename>examples/xaction.cpp</filename> illustrates
+ this:</para>
+
+ <programlisting><xi:include href="xaction.txt"
+ parse="text"
xmlns:xi="http://www.w3.org/2001/XInclude"/>
+ </programlisting>
</sect2>
Modified: branches/v2.1-bakefile/lib/transaction.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/branches/v2.1-bakefile/lib/transaction.h?rev=1262&r1=1261&r2=1262&view=diff
==============================================================================
--- branches/v2.1-bakefile/lib/transaction.h (original)
+++ branches/v2.1-bakefile/lib/transaction.h Sat Mar 18 06:07:05 2006
@@ -36,6 +36,8 @@
namespace mysqlpp {
class Connection;
+
+/// \brief Helper object for creating exception-safe SQL transactions.
class Transaction
{
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits