Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-testing > by-pkgid > 91128064e1b251eab84e1c0e3ea0dd7a > files > 140

lib64mysql-devel-5.0.51a-8mdv2008.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>NdbTransaction Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.5 -->
<div class="contents">
<h1>NdbTransaction Class Reference</h1><!-- doxytag: class="NdbTransaction" --><code>#include &lt;NdbTransaction.hpp&gt;</code>
<p>

<p>
<a href="classNdbTransaction-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
Represents a transaction. 
<p>
A transaction (represented by an <a class="el" href="classNdbTransaction.html" title="Represents a transaction.">NdbTransaction</a> object) belongs to an <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> object and is created using <a class="el" href="classNdb.html#7e34bb5d8e3d878a54ebb7c0e6d0c5f1">Ndb::startTransaction()</a>. A transaction consists of a list of operations (represented by <a class="el" href="classNdbOperation.html" title="Class of operations for use in transactions.">NdbOperation</a>, <a class="el" href="classNdbScanOperation.html" title="Class of scan operations for use in transactions.">NdbScanOperation</a>, <a class="el" href="classNdbIndexOperation.html" title="Class of index operations for use in transactions.">NdbIndexOperation</a>, and <a class="el" href="classNdbIndexScanOperation.html" title="Class of scan operations for use to scan ordered index.">NdbIndexScanOperation</a> objects). Each operation access exactly one table.<p>
After getting the <a class="el" href="classNdbTransaction.html" title="Represents a transaction.">NdbTransaction</a> object, the first step is to get (allocate) an operation given the table name using one of the methods <a class="el" href="classNdbTransaction.html#2aeb211e54f84bd2de6cfb8fccec8166">getNdbOperation()</a>, <a class="el" href="classNdbTransaction.html#165fbac99710fd693485b16d073957dd">getNdbScanOperation()</a>, <a class="el" href="classNdbTransaction.html#4314de6305b86f4a3811ee97e7000f87">getNdbIndexOperation()</a>, or <a class="el" href="classNdbTransaction.html#b199e982a860740bca8150801cddde94">getNdbIndexScanOperation()</a>. Then the operation is defined. Several operations can be defined on the same <a class="el" href="classNdbTransaction.html" title="Represents a transaction.">NdbTransaction</a> object, they will in that case be executed in parallell. When all operations are defined, the <a class="el" href="classNdbTransaction.html#361d5a82078f86a5d18923f56d43cc84">execute()</a> method sends them to the NDB kernel for execution.<p>
The <a class="el" href="classNdbTransaction.html#361d5a82078f86a5d18923f56d43cc84">execute()</a> method returns when the NDB kernel has completed execution of all operations defined before the call to <a class="el" href="classNdbTransaction.html#361d5a82078f86a5d18923f56d43cc84">execute()</a>. All allocated operations should be properly defined before calling <a class="el" href="classNdbTransaction.html#361d5a82078f86a5d18923f56d43cc84">execute()</a>.<p>
A call to <a class="el" href="classNdbTransaction.html#361d5a82078f86a5d18923f56d43cc84">execute()</a> uses one out of three types of execution:<ol type=1>
<li><a class="el" href="classNdbTransaction.html#2d2a5911b91e5cf78da970a1e97f7e3ed2041cab47f522aa4365d70a49267d6d">NdbTransaction::NoCommit</a> Executes operations without committing them.</li><li><a class="el" href="classNdbTransaction.html#2d2a5911b91e5cf78da970a1e97f7e3ecaba2931e541dd138044b61f38918391" title="Execute and try to commit the transaction.">NdbTransaction::Commit</a> Executes remaining operation and commits the complete transaction</li><li><a class="el" href="classNdbTransaction.html#2d2a5911b91e5cf78da970a1e97f7e3e42e1d19d9a9d3328bfe713cba07fc298" title="Rollback transaction.">NdbTransaction::Rollback</a> Rollbacks the entire transaction.</li></ol>
<p>
<a class="el" href="classNdbTransaction.html#361d5a82078f86a5d18923f56d43cc84">execute()</a> is equipped with an extra error handling parameter. There are two alternatives:<ol type=1>
<li><a class="el" href="classNdbTransaction.html#a9ba379b5a51104877048e62411be49d9898c643487f62a020ca65fa037ef421" title="Abort transaction on failed operation.">NdbTransaction::AbortOnError</a> (default). The transaction is aborted if there are any error during the execution</li><li><a class="el" href="classNdbTransaction.html#a9ba379b5a51104877048e62411be49d812a589c3adadc141f227d6c26ab381d" title="Transaction continues on failed operation.">NdbTransaction::AO_IgnoreError</a> Continue execution of transaction even if operation fails </li></ol>
<h2>Meta Information</h2>
<ul>
<li>enum <a class="el" href="classNdbTransaction.html#604a36e363b3a87501c25c8f641ee4e6">CommitStatusType</a> { <br>
&nbsp;&nbsp;<a class="el" href="classNdbTransaction.html#604a36e363b3a87501c25c8f641ee4e651960f7e1433ccdedd898b7b8b4b3205">NotStarted</a>, 
<a class="el" href="classNdbTransaction.html#604a36e363b3a87501c25c8f641ee4e657542958936f6d4432a916a3b4dcea4f">Started</a>, 
<a class="el" href="classNdbTransaction.html#604a36e363b3a87501c25c8f641ee4e6d42991f2b9c30aab50f2c179a91e55ed">Committed</a>, 
<a class="el" href="classNdbTransaction.html#604a36e363b3a87501c25c8f641ee4e632e4eb52a08cf3aadc06f29292dae500">Aborted</a>, 
<br>
&nbsp;&nbsp;<a class="el" href="classNdbTransaction.html#604a36e363b3a87501c25c8f641ee4e6277a3e5b7ecee13ca910fb97541763b8">NeedAbort</a>
<br>
 }
<li>int <a class="el" href="classNdbTransaction.html#b9a4df180f50432f2cd15749a4f1e5da">getGCI</a> ()
<li>Uint64 <a class="el" href="classNdbTransaction.html#5e05b16f69bd173860c078c6c2f1ff5f">getTransactionId</a> ()
<li><a class="el" href="classNdbTransaction.html#604a36e363b3a87501c25c8f641ee4e6">CommitStatusType</a> <a class="el" href="classNdbTransaction.html#a69f5c397309c187f35adfe14a9345c9">commitStatus</a> ()
</ul>
<h2>Error Handling</h2>
<ul>
<li>const <a class="el" href="structNdbError.html">NdbError</a> &amp; <a class="el" href="classNdbTransaction.html#f4af91ca21b97c4fe6256a18903020fc">getNdbError</a> () const 
<li><a class="el" href="classNdbOperation.html">NdbOperation</a> * <a class="el" href="classNdbTransaction.html#6b2b1b7e05d9cc5ecd958fc49a17a109">getNdbErrorOperation</a> ()
<li>int <a class="el" href="classNdbTransaction.html#dc51806a1bc3b7a727d54e05c71d6f22">getNdbErrorLine</a> ()
<li>const <a class="el" href="classNdbOperation.html">NdbOperation</a> * <a class="el" href="classNdbTransaction.html#cc45eb0b457f25f0615667a16cc44f73">getNextCompletedOperation</a> (const <a class="el" href="classNdbOperation.html">NdbOperation</a> *op) const 
</ul>
<h2>Public Types</h2>
<ul>
<li>enum <a class="el" href="classNdbTransaction.html#a9ba379b5a51104877048e62411be49d">AbortOption</a> { <a class="el" href="classNdbTransaction.html#a9ba379b5a51104877048e62411be49d9898c643487f62a020ca65fa037ef421">AbortOnError</a>, 
<a class="el" href="classNdbTransaction.html#a9ba379b5a51104877048e62411be49d812a589c3adadc141f227d6c26ab381d">AO_IgnoreError</a>
 }
<li>enum <a class="el" href="classNdbTransaction.html#2d2a5911b91e5cf78da970a1e97f7e3e">ExecType</a> { <a class="el" href="classNdbTransaction.html#2d2a5911b91e5cf78da970a1e97f7e3ed2041cab47f522aa4365d70a49267d6d">NoCommit</a>, 
<a class="el" href="classNdbTransaction.html#2d2a5911b91e5cf78da970a1e97f7e3ecaba2931e541dd138044b61f38918391">Commit</a>, 
<a class="el" href="classNdbTransaction.html#2d2a5911b91e5cf78da970a1e97f7e3e42e1d19d9a9d3328bfe713cba07fc298">Rollback</a>
 }
</ul>
<h2>Public Member Functions</h2>
<ul>
<li><a class="el" href="classNdbOperation.html">NdbOperation</a> * <a class="el" href="classNdbTransaction.html#2aeb211e54f84bd2de6cfb8fccec8166">getNdbOperation</a> (const <a class="el" href="classNdbDictionary_1_1Table.html">NdbDictionary::Table</a> *aTable)
<li><a class="el" href="classNdbScanOperation.html">NdbScanOperation</a> * <a class="el" href="classNdbTransaction.html#165fbac99710fd693485b16d073957dd">getNdbScanOperation</a> (const <a class="el" href="classNdbDictionary_1_1Table.html">NdbDictionary::Table</a> *aTable)
<li><a class="el" href="classNdbIndexScanOperation.html">NdbIndexScanOperation</a> * <a class="el" href="classNdbTransaction.html#b199e982a860740bca8150801cddde94">getNdbIndexScanOperation</a> (const <a class="el" href="classNdbDictionary_1_1Index.html">NdbDictionary::Index</a> *anIndex)
<li><a class="el" href="classNdbIndexOperation.html">NdbIndexOperation</a> * <a class="el" href="classNdbTransaction.html#4314de6305b86f4a3811ee97e7000f87">getNdbIndexOperation</a> (const <a class="el" href="classNdbDictionary_1_1Index.html">NdbDictionary::Index</a> *anIndex)
</ul>
<tr><td colspan="2"><div class="groupHeader">Execute Transaction</div></td></tr>
<ul>
<li>int <a class="el" href="classNdbTransaction.html#361d5a82078f86a5d18923f56d43cc84">execute</a> (<a class="el" href="classNdbTransaction.html#2d2a5911b91e5cf78da970a1e97f7e3e">ExecType</a> execType, <a class="el" href="classNdbTransaction.html#a9ba379b5a51104877048e62411be49d">AbortOption</a> abortOption=AbortOnError, int force=0)
<li>int <a class="el" href="classNdbTransaction.html#860905d8a74f8f40ddd78a40a977bd0f">refresh</a> ()
<li>void <a class="el" href="classNdbTransaction.html#967f0c6f7c920cfa1140f005144a3a91">close</a> ()
</ul>
<hr><h2>Member Enumeration Documentation</h2>
<a class="anchor" name="a9ba379b5a51104877048e62411be49d"></a><!-- doxytag: member="NdbTransaction::AbortOption" ref="a9ba379b5a51104877048e62411be49d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classNdbTransaction.html#a9ba379b5a51104877048e62411be49d">NdbTransaction::AbortOption</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Commit type of transaction <dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" name="a9ba379b5a51104877048e62411be49d9898c643487f62a020ca65fa037ef421"></a><!-- doxytag: member="AbortOnError" ref="a9ba379b5a51104877048e62411be49d9898c643487f62a020ca65fa037ef421" args="" -->AbortOnError</em>&nbsp;</td><td>
Abort transaction on failed operation. </td></tr>
<tr><td valign="top"><em><a class="anchor" name="a9ba379b5a51104877048e62411be49d812a589c3adadc141f227d6c26ab381d"></a><!-- doxytag: member="AO_IgnoreError" ref="a9ba379b5a51104877048e62411be49d812a589c3adadc141f227d6c26ab381d" args="" -->AO_IgnoreError</em>&nbsp;</td><td>
Transaction continues on failed operation. </td></tr>
</table>
</dl>

</div>
</div><p>
<a class="anchor" name="2d2a5911b91e5cf78da970a1e97f7e3e"></a><!-- doxytag: member="NdbTransaction::ExecType" ref="2d2a5911b91e5cf78da970a1e97f7e3e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classNdbTransaction.html#2d2a5911b91e5cf78da970a1e97f7e3e">NdbTransaction::ExecType</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Execution type of transaction <dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" name="2d2a5911b91e5cf78da970a1e97f7e3ed2041cab47f522aa4365d70a49267d6d"></a><!-- doxytag: member="NoCommit" ref="2d2a5911b91e5cf78da970a1e97f7e3ed2041cab47f522aa4365d70a49267d6d" args="" -->NoCommit</em>&nbsp;</td><td>
Execute the transaction as far as it has been defined, but do not yet commit it </td></tr>
<tr><td valign="top"><em><a class="anchor" name="2d2a5911b91e5cf78da970a1e97f7e3ecaba2931e541dd138044b61f38918391"></a><!-- doxytag: member="Commit" ref="2d2a5911b91e5cf78da970a1e97f7e3ecaba2931e541dd138044b61f38918391" args="" -->Commit</em>&nbsp;</td><td>
Execute and try to commit the transaction. </td></tr>
<tr><td valign="top"><em><a class="anchor" name="2d2a5911b91e5cf78da970a1e97f7e3e42e1d19d9a9d3328bfe713cba07fc298"></a><!-- doxytag: member="Rollback" ref="2d2a5911b91e5cf78da970a1e97f7e3e42e1d19d9a9d3328bfe713cba07fc298" args="" -->Rollback</em>&nbsp;</td><td>
Rollback transaction. </td></tr>
</table>
</dl>

</div>
</div><p>
<a class="anchor" name="604a36e363b3a87501c25c8f641ee4e6"></a><!-- doxytag: member="NdbTransaction::CommitStatusType" ref="604a36e363b3a87501c25c8f641ee4e6" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classNdbTransaction.html#604a36e363b3a87501c25c8f641ee4e6">NdbTransaction::CommitStatusType</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
The commit status of the transaction. <dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" name="604a36e363b3a87501c25c8f641ee4e651960f7e1433ccdedd898b7b8b4b3205"></a><!-- doxytag: member="NotStarted" ref="604a36e363b3a87501c25c8f641ee4e651960f7e1433ccdedd898b7b8b4b3205" args="" -->NotStarted</em>&nbsp;</td><td>
Transaction not yet started. </td></tr>
<tr><td valign="top"><em><a class="anchor" name="604a36e363b3a87501c25c8f641ee4e657542958936f6d4432a916a3b4dcea4f"></a><!-- doxytag: member="Started" ref="604a36e363b3a87501c25c8f641ee4e657542958936f6d4432a916a3b4dcea4f" args="" -->Started</em>&nbsp;</td><td>
<em>Missing explanation</em> </td></tr>
<tr><td valign="top"><em><a class="anchor" name="604a36e363b3a87501c25c8f641ee4e6d42991f2b9c30aab50f2c179a91e55ed"></a><!-- doxytag: member="Committed" ref="604a36e363b3a87501c25c8f641ee4e6d42991f2b9c30aab50f2c179a91e55ed" args="" -->Committed</em>&nbsp;</td><td>
Transaction has been committed. </td></tr>
<tr><td valign="top"><em><a class="anchor" name="604a36e363b3a87501c25c8f641ee4e632e4eb52a08cf3aadc06f29292dae500"></a><!-- doxytag: member="Aborted" ref="604a36e363b3a87501c25c8f641ee4e632e4eb52a08cf3aadc06f29292dae500" args="" -->Aborted</em>&nbsp;</td><td>
Transaction has been aborted. </td></tr>
<tr><td valign="top"><em><a class="anchor" name="604a36e363b3a87501c25c8f641ee4e6277a3e5b7ecee13ca910fb97541763b8"></a><!-- doxytag: member="NeedAbort" ref="604a36e363b3a87501c25c8f641ee4e6277a3e5b7ecee13ca910fb97541763b8" args="" -->NeedAbort</em>&nbsp;</td><td>
<em>Missing explanation</em> </td></tr>
</table>
</dl>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="2aeb211e54f84bd2de6cfb8fccec8166"></a><!-- doxytag: member="NdbTransaction::getNdbOperation" ref="2aeb211e54f84bd2de6cfb8fccec8166" args="(const NdbDictionary::Table *aTable)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classNdbOperation.html">NdbOperation</a>* NdbTransaction::getNdbOperation           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classNdbDictionary_1_1Table.html">NdbDictionary::Table</a> *&nbsp;</td>
          <td class="paramname"> <em>aTable</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get an <a class="el" href="classNdbOperation.html" title="Class of operations for use in transactions.">NdbOperation</a> for a table. Note that the operation has to be defined before it is executed.<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>All operations within the same transaction need to be initialized with this method.</dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>aTable</em>&nbsp;</td><td>A table object (fetched by <a class="el" href="classNdbDictionary_1_1Dictionary.html#1a30b1bb5fa164113cb839eed64eb3b6">NdbDictionary::Dictionary::getTable</a>) </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Pointer to an <a class="el" href="classNdbOperation.html" title="Class of operations for use in transactions.">NdbOperation</a> object if successful, otherwise NULL. </dd></dl>

</div>
</div><p>
<a class="anchor" name="165fbac99710fd693485b16d073957dd"></a><!-- doxytag: member="NdbTransaction::getNdbScanOperation" ref="165fbac99710fd693485b16d073957dd" args="(const NdbDictionary::Table *aTable)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classNdbScanOperation.html">NdbScanOperation</a>* NdbTransaction::getNdbScanOperation           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classNdbDictionary_1_1Table.html">NdbDictionary::Table</a> *&nbsp;</td>
          <td class="paramname"> <em>aTable</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get an operation from <a class="el" href="classNdbScanOperation.html" title="Class of scan operations for use in transactions.">NdbScanOperation</a> idlelist and get the <a class="el" href="classNdbTransaction.html" title="Represents a transaction.">NdbTransaction</a> object which was fetched by startTransaction pointing to this operation.<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>aTable</em>&nbsp;</td><td>A table object (fetched by <a class="el" href="classNdbDictionary_1_1Dictionary.html#1a30b1bb5fa164113cb839eed64eb3b6">NdbDictionary::Dictionary::getTable</a>) </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>pointer to an <a class="el" href="classNdbOperation.html" title="Class of operations for use in transactions.">NdbOperation</a> object if successful, otherwise NULL </dd></dl>

</div>
</div><p>
<a class="anchor" name="b199e982a860740bca8150801cddde94"></a><!-- doxytag: member="NdbTransaction::getNdbIndexScanOperation" ref="b199e982a860740bca8150801cddde94" args="(const NdbDictionary::Index *anIndex)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classNdbIndexScanOperation.html">NdbIndexScanOperation</a>* NdbTransaction::getNdbIndexScanOperation           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classNdbDictionary_1_1Index.html">NdbDictionary::Index</a> *&nbsp;</td>
          <td class="paramname"> <em>anIndex</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get an operation from <a class="el" href="classNdbIndexScanOperation.html" title="Class of scan operations for use to scan ordered index.">NdbIndexScanOperation</a> idlelist and get the <a class="el" href="classNdbTransaction.html" title="Represents a transaction.">NdbTransaction</a> object which was fetched by startTransaction pointing to this operation.<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>anIndex</em>&nbsp;</td><td>An index object (fetched by <a class="el" href="classNdbDictionary_1_1Dictionary.html#906abbe199490648d092c9096dddbc18">NdbDictionary::Dictionary::getIndex</a>). </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>pointer to an <a class="el" href="classNdbOperation.html" title="Class of operations for use in transactions.">NdbOperation</a> object if successful, otherwise NULL </dd></dl>

</div>
</div><p>
<a class="anchor" name="4314de6305b86f4a3811ee97e7000f87"></a><!-- doxytag: member="NdbTransaction::getNdbIndexOperation" ref="4314de6305b86f4a3811ee97e7000f87" args="(const NdbDictionary::Index *anIndex)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classNdbIndexOperation.html">NdbIndexOperation</a>* NdbTransaction::getNdbIndexOperation           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classNdbDictionary_1_1Index.html">NdbDictionary::Index</a> *&nbsp;</td>
          <td class="paramname"> <em>anIndex</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get an operation from <a class="el" href="classNdbIndexOperation.html" title="Class of index operations for use in transactions.">NdbIndexOperation</a> idlelist and get the <a class="el" href="classNdbTransaction.html" title="Represents a transaction.">NdbTransaction</a> object that was fetched by startTransaction pointing to this operation.<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>anIndex</em>&nbsp;</td><td>An index object (fetched by <a class="el" href="classNdbDictionary_1_1Dictionary.html#906abbe199490648d092c9096dddbc18">NdbDictionary::Dictionary::getIndex</a>). </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Pointer to an <a class="el" href="classNdbIndexOperation.html" title="Class of index operations for use in transactions.">NdbIndexOperation</a> object if successful, otherwise NULL </dd></dl>

</div>
</div><p>
<a class="anchor" name="361d5a82078f86a5d18923f56d43cc84"></a><!-- doxytag: member="NdbTransaction::execute" ref="361d5a82078f86a5d18923f56d43cc84" args="(ExecType execType, AbortOption abortOption=AbortOnError, int force=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NdbTransaction::execute           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classNdbTransaction.html#2d2a5911b91e5cf78da970a1e97f7e3e">ExecType</a>&nbsp;</td>
          <td class="paramname"> <em>execType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classNdbTransaction.html#a9ba379b5a51104877048e62411be49d">AbortOption</a>&nbsp;</td>
          <td class="paramname"> <em>abortOption</em> = <code>AbortOnError</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>force</em> = <code>0</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>
Executes transaction.<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>execType</em>&nbsp;</td><td>Execution type:<br>
 ExecType::NoCommit executes operations without committing them.<br>
 ExecType::Commit executes remaining operations and commits the complete transaction.<br>
 ExecType::Rollback rollbacks the entire transaction. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>abortOption</em>&nbsp;</td><td>Handling of error while excuting AbortOnError - Abort transaction if an operation fail IgnoreError - Accept failing operations </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>force</em>&nbsp;</td><td>When operations should be sent to NDB Kernel. (See <a class="el" href="secAdapt.html">Adaptive Send Algorithm</a>.)<ul>
<li>0: non-force, adaptive algorithm notices it (default);</li><li>1: force send, adaptive algorithm notices it;</li><li>2: non-force, adaptive algorithm do not notice the send. </li></ul>
</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if successful otherwise -1. </dd></dl>

</div>
</div><p>
<a class="anchor" name="860905d8a74f8f40ddd78a40a977bd0f"></a><!-- doxytag: member="NdbTransaction::refresh" ref="860905d8a74f8f40ddd78a40a977bd0f" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NdbTransaction::refresh           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Refresh Update timeout counter of this transaction in the database. If you want to keep the transaction active in the database longer than the transaction abort timeout. <dl class="note" compact><dt><b>Note:</b></dt><dd>It's not advised to take a lock on a record and keep it for a extended time since this can impact other transactions. </dd></dl>

</div>
</div><p>
<a class="anchor" name="967f0c6f7c920cfa1140f005144a3a91"></a><!-- doxytag: member="NdbTransaction::close" ref="967f0c6f7c920cfa1140f005144a3a91" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void NdbTransaction::close           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Close transaction<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Equivalent to to calling <a class="el" href="classNdb.html#afbf5620c516bf18e0a3d3bacaf38e67">Ndb::closeTransaction()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="b9a4df180f50432f2cd15749a4f1e5da"></a><!-- doxytag: member="NdbTransaction::getGCI" ref="b9a4df180f50432f2cd15749a4f1e5da" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NdbTransaction::getGCI           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get global checkpoint identity (GCI) of transaction.<p>
Each committed transaction belong to a GCI. The log for the committed transaction is saved on disk when a global checkpoint occurs.<p>
Whether or not the global checkpoint with this GCI has been saved on disk or not cannot be determined by this method.<p>
By comparing the GCI of a transaction with the value last GCI restored in a restarted NDB Cluster one can determine whether the transaction was restored or not.<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Global Checkpoint Identity is undefined for scan transactions (This is because no updates are performed in scan transactions.)</dd></dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>GCI of transaction or -1 if GCI is not available. (Note that there has to be an <a class="el" href="classNdbTransaction.html#361d5a82078f86a5d18923f56d43cc84">NdbTransaction::execute</a> call with Ndb::Commit for the GCI to be available.) </dd></dl>

</div>
</div><p>
<a class="anchor" name="5e05b16f69bd173860c078c6c2f1ff5f"></a><!-- doxytag: member="NdbTransaction::getTransactionId" ref="5e05b16f69bd173860c078c6c2f1ff5f" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Uint64 NdbTransaction::getTransactionId           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get transaction identity.<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Transaction id. </dd></dl>

</div>
</div><p>
<a class="anchor" name="a69f5c397309c187f35adfe14a9345c9"></a><!-- doxytag: member="NdbTransaction::commitStatus" ref="a69f5c397309c187f35adfe14a9345c9" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classNdbTransaction.html#604a36e363b3a87501c25c8f641ee4e6">CommitStatusType</a> NdbTransaction::commitStatus           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the commit status of the transaction.<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The commit status of the transaction </dd></dl>

</div>
</div><p>
<a class="anchor" name="f4af91ca21b97c4fe6256a18903020fc"></a><!-- doxytag: member="NdbTransaction::getNdbError" ref="f4af91ca21b97c4fe6256a18903020fc" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structNdbError.html">NdbError</a>&amp; NdbTransaction::getNdbError           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get error object with information about the latest error.<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>An error object with information about the latest error. </dd></dl>

</div>
</div><p>
<a class="anchor" name="6b2b1b7e05d9cc5ecd958fc49a17a109"></a><!-- doxytag: member="NdbTransaction::getNdbErrorOperation" ref="6b2b1b7e05d9cc5ecd958fc49a17a109" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classNdbOperation.html">NdbOperation</a>* NdbTransaction::getNdbErrorOperation           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the latest <a class="el" href="classNdbOperation.html" title="Class of operations for use in transactions.">NdbOperation</a> which had an error. This method is used on the <a class="el" href="classNdbTransaction.html" title="Represents a transaction.">NdbTransaction</a> object to find the <a class="el" href="classNdbOperation.html" title="Class of operations for use in transactions.">NdbOperation</a> causing an error. To find more information about the actual error, use method <a class="el" href="classNdbOperation.html#9e9aa90dcdbdc02066f3b386ebb79d04">NdbOperation::getNdbError()</a> on the returned <a class="el" href="classNdbOperation.html" title="Class of operations for use in transactions.">NdbOperation</a> object.<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The <a class="el" href="classNdbOperation.html" title="Class of operations for use in transactions.">NdbOperation</a> causing the latest error. </dd></dl>

</div>
</div><p>
<a class="anchor" name="dc51806a1bc3b7a727d54e05c71d6f22"></a><!-- doxytag: member="NdbTransaction::getNdbErrorLine" ref="dc51806a1bc3b7a727d54e05c71d6f22" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NdbTransaction::getNdbErrorLine           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the method number where the latest error occured.<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Line number where latest error occured. </dd></dl>

</div>
</div><p>
<a class="anchor" name="cc45eb0b457f25f0615667a16cc44f73"></a><!-- doxytag: member="NdbTransaction::getNextCompletedOperation" ref="cc45eb0b457f25f0615667a16cc44f73" args="(const NdbOperation *op) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classNdbOperation.html">NdbOperation</a>* NdbTransaction::getNextCompletedOperation           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classNdbOperation.html">NdbOperation</a> *&nbsp;</td>
          <td class="paramname"> <em>op</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get completed (i.e. executed) operations of a transaction<p>
This method should only be used <em>after</em> a transaction has been executed.<ul>
<li>NdbTransaction::getNextCompletedOperation(NULL) returns the first <a class="el" href="classNdbOperation.html" title="Class of operations for use in transactions.">NdbOperation</a> object.</li><li>NdbTransaction::getNextCompletedOperation(op) returns the <a class="el" href="classNdbOperation.html" title="Class of operations for use in transactions.">NdbOperation</a> object defined after the <a class="el" href="classNdbOperation.html" title="Class of operations for use in transactions.">NdbOperation</a> "op".</li></ul>
<p>
This method is typically used to fetch all <a class="el" href="classNdbOperation.html" title="Class of operations for use in transactions.">NdbOperation</a>:s of a transaction to check for errors (use <a class="el" href="classNdbOperation.html#9e9aa90dcdbdc02066f3b386ebb79d04">NdbOperation::getNdbError</a> to fetch the <a class="el" href="structNdbError.html" title="Contains error information.">NdbError</a> object of an <a class="el" href="classNdbOperation.html" title="Class of operations for use in transactions.">NdbOperation</a>).<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>This method should only be used after the transaction has been executed and before the transaction has been closed.</dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>op</em>&nbsp;</td><td>Operation, NULL means get first operation </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Operation "after" op </dd></dl>

</div>
</div><p>
</div>
<hr>
<address>
<small>
<center>
Documentation generated Sun Apr 20 06:25:31 2008 from mysql source files.<br>
&copy; 2003-2004 
<a href="http://www.mysql.com">MySQL AB</a>
<br>
</center>
</small></address>
</body>
</html>