1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>DB_TXN->discard()</title> 7 <link rel="stylesheet" href="apiReference.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB C API Reference" /> 10 <link rel="up" href="txn.html" title="Chapter 12. The DB_TXN Handle" /> 11 <link rel="prev" href="txncommit.html" title="DB_TXN->commit()" /> 12 <link rel="next" href="txnget_name.html" title="DB_TXN->get_name()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DB_TXN->discard()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="txncommit.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 12. 23 The DB_TXN Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="txnget_name.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="txndiscard"></a>DB_TXN->discard()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40int 41DB_TXN->discard(DB_TXN *tid, u_int32_t flags); </pre> 42 <p> 43 The <code class="methodname">DB_TXN->discard()</code> method frees up all the per-process resources 44 associated with the specified <a class="link" href="txn.html" title="Chapter 12. The DB_TXN Handle">DB_TXN</a> handle, neither 45 committing nor aborting the transaction. This call may be used only 46 after calls to <a class="xref" href="txnrecover.html" title="DB_ENV->txn_recover()">DB_ENV->txn_recover()</a> when 47 there are multiple global transaction managers recovering transactions 48 in a single Berkeley DB environment. Any transactions returned by 49 <a class="xref" href="txnrecover.html" title="DB_ENV->txn_recover()">DB_ENV->txn_recover()</a> 50 that are not handled by the current global transaction manager should 51 be discarded using <code class="methodname">DB_TXN->discard()</code>. 52 </p> 53 <p> 54 The <code class="methodname">DB_TXN->discard()</code> <span> 55 <span> 56 method returns a non-zero error value on failure and 0 on success. 57 </span> 58 59 </span> 60 </p> 61 <p> 62 After <code class="methodname">DB_TXN->discard()</code> has been called, regardless of its return, 63 the <a class="link" href="txn.html" title="Chapter 12. The DB_TXN Handle">DB_TXN</a> handle may not 64 be accessed again. 65 </p> 66 <div class="sect2" lang="en" xml:lang="en"> 67 <div class="titlepage"> 68 <div> 69 <div> 70 <h3 class="title"><a id="id1709151"></a>Parameters</h3> 71 </div> 72 </div> 73 </div> 74 <div class="sect3" lang="en" xml:lang="en"> 75 <div class="titlepage"> 76 <div> 77 <div> 78 <h4 class="title"><a id="id1709205"></a>flags</h4> 79 </div> 80 </div> 81 </div> 82 <p> 83 The <span class="bold"><strong>flags</strong></span> parameter is currently 84 unused, and must be set to 0. 85 </p> 86 </div> 87 </div> 88 <div class="sect2" lang="en" xml:lang="en"> 89 <div class="titlepage"> 90 <div> 91 <div> 92 <h3 class="title"><a id="id1709344"></a>Errors</h3> 93 </div> 94 </div> 95 </div> 96 <p> 97 The <code class="methodname">DB_TXN->discard()</code> <span> 98 <span> 99 method may fail and return one of the following non-zero errors: 100 </span> 101 102 </span> 103 </p> 104 <div class="sect3" lang="en" xml:lang="en"> 105 <div class="titlepage"> 106 <div> 107 <div> 108 <h4 class="title"><a id="id1709281"></a>EINVAL</h4> 109 </div> 110 </div> 111 </div> 112 <p> 113 If the transaction handle does not refer to a transaction that was 114 recovered into a prepared but not yet completed state; or if an 115 invalid flag value or parameter was specified. 116 </p> 117 </div> 118 </div> 119 <div class="sect2" lang="en" xml:lang="en"> 120 <div class="titlepage"> 121 <div> 122 <div> 123 <h3 class="title"><a id="id1709296"></a>Class</h3> 124 </div> 125 </div> 126 </div> 127 <p> 128 <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a>, <a class="link" href="txn.html" title="Chapter 12. The DB_TXN Handle">DB_TXN</a> 129 </p> 130 </div> 131 <div class="sect2" lang="en" xml:lang="en"> 132 <div class="titlepage"> 133 <div> 134 <div> 135 <h3 class="title"><a id="id1709419"></a>See Also</h3> 136 </div> 137 </div> 138 </div> 139 <p> 140 <a class="xref" href="txn.html#txnlist" title="Transaction Subsystem and Related Methods">Transaction Subsystem and Related Methods</a> 141 </p> 142 </div> 143 </div> 144 <div class="navfooter"> 145 <hr /> 146 <table width="100%" summary="Navigation footer"> 147 <tr> 148 <td width="40%" align="left"><a accesskey="p" href="txncommit.html">Prev</a> </td> 149 <td width="20%" align="center"> 150 <a accesskey="u" href="txn.html">Up</a> 151 </td> 152 <td width="40%" align="right"> <a accesskey="n" href="txnget_name.html">Next</a></td> 153 </tr> 154 <tr> 155 <td width="40%" align="left" valign="top">DB_TXN->commit() </td> 156 <td width="20%" align="center"> 157 <a accesskey="h" href="index.html">Home</a> 158 </td> 159 <td width="40%" align="right" valign="top"> DB_TXN->get_name()</td> 160 </tr> 161 </table> 162 </div> 163 </body> 164</html> 165