File: classmysqlpp_1_1Transaction.html

package info (click to toggle)
mysql%2B%2B 3.0.0-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 10,328 kB
  • ctags: 9,487
  • sloc: cpp: 33,486; sh: 3,091; perl: 809; makefile: 683
file content (163 lines) | stat: -rw-r--r-- 8,343 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>MySQL++ Reference Manual</title>
	<meta http-equiv="Content-type" content="text/html;charset=iso-8859-1">
	<link href="doxygen.css" rel="stylesheet" type="text/css">
	<link href="refman.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li id="current"><a href="annotated.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul></div>
<div class="nav">
<b>mysqlpp</b>::<a class="el" href="classmysqlpp_1_1Transaction.html">Transaction</a></div>
<h1>mysqlpp::Transaction Class Reference</h1><!-- doxytag: class="mysqlpp::Transaction" -->Helper object for creating exception-safe SQL transactions.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="transaction_8h-source.html">transaction.h</a>&gt;</code>
<p>
Collaboration diagram for mysqlpp::Transaction:<p><center><img src="classmysqlpp_1_1Transaction__coll__graph.png" border="0" usemap="#mysqlpp_1_1Transaction__coll__map" alt="Collaboration graph"></center>
<map name="mysqlpp_1_1Transaction__coll__map">
<area href="classmysqlpp_1_1Connection.html" shape="rect" coords="192,97,352,121" alt="">
<area href="classmysqlpp_1_1OptionalExceptions.html" shape="rect" coords="5,7,219,31" alt="">
<area href="classmysqlpp_1_1DBDriver.html" shape="rect" coords="333,7,480,31" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classmysqlpp_1_1Transaction-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Transaction.html#5472100c371746d23311bbd74067c5dc">Transaction</a> (<a class="el" href="classmysqlpp_1_1Connection.html">Connection</a> &amp;conn, bool consistent=false)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor.  <a href="#5472100c371746d23311bbd74067c5dc"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Transaction.html#362b0d2524d0c799165190517192dca9">~Transaction</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor.  <a href="#362b0d2524d0c799165190517192dca9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Transaction.html#109bd0f1d70b6ff69cf3abccf7eea8f8">commit</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Commits the transaction.  <a href="#109bd0f1d70b6ff69cf3abccf7eea8f8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Transaction.html#000e4f0882139eb8470f7472ca14a24e">rollback</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Rolls back the transaction.  <a href="#000e4f0882139eb8470f7472ca14a24e"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Helper object for creating exception-safe SQL transactions. 
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="5472100c371746d23311bbd74067c5dc"></a><!-- doxytag: member="mysqlpp::Transaction::Transaction" ref="5472100c371746d23311bbd74067c5dc" args="(Connection &amp;conn, bool consistent=false)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Transaction::Transaction           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmysqlpp_1_1Connection.html">Connection</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>conn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>consistent</em> = <code>false</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Constructor. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>conn</em>&nbsp;</td><td>The connection we use to manage the transaction set </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>consistent</em>&nbsp;</td><td>Whether to use "consistent snapshots" during the transaction. See the documentation for "START TRANSACTION" in the MySQL manual for more on this. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="362b0d2524d0c799165190517192dca9"></a><!-- doxytag: member="mysqlpp::Transaction::~Transaction" ref="362b0d2524d0c799165190517192dca9" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Transaction::~Transaction           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destructor. 
<p>
If the transaction has not been committed or rolled back by the time the destructor is called, it is rolled back. This is the right thing because one way this can happen is if the object is being destroyed as the stack is unwound to handle an exception. In that instance, you certainly want to roll back the transaction. 
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="109bd0f1d70b6ff69cf3abccf7eea8f8"></a><!-- doxytag: member="mysqlpp::Transaction::commit" ref="109bd0f1d70b6ff69cf3abccf7eea8f8" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Transaction::commit           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Commits the transaction. 
<p>
This commits all updates to the database using the connection we were created with since this object was created. This is a no-op if the table isn't stored using a transaction-aware storage engine. See CREATE TABLE in the MySQL manual for details. 
</div>
</div><p>
<a class="anchor" name="000e4f0882139eb8470f7472ca14a24e"></a><!-- doxytag: member="mysqlpp::Transaction::rollback" ref="000e4f0882139eb8470f7472ca14a24e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Transaction::rollback           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Rolls back the transaction. 
<p>
This abandons all SQL statements made on the connection since this object was created. This only works on tables stored using a transaction-aware storage engine. See CREATE TABLE in the MySQL manual for details. 
</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="transaction_8h-source.html">transaction.h</a><li>transaction.cpp</ul>
<hr size="1"><address style="align: right;"><small>Generated on Fri Feb 29 16:26:50 2008 for MySQL++ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>