doc-exports/docs/dws/dev/dws_06_0260.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:24:04 +00:00

29 lines
4.0 KiB
HTML

<a name="EN-US_TOPIC_0000001188270562"></a><a name="EN-US_TOPIC_0000001188270562"></a>
<h1 class="topictitle1">COMMIT PREPARED</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001188270562__sb4ed7d6e55f94dbea1916c06d862aa42"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001188270562__a1220d341726440e9b5799224c24e8c4b"><strong id="EN-US_TOPIC_0000001188270562__b5173105869393">COMMIT PREPARED</strong> commits a prepared two-phase transaction.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188270562__sbd9f3b0bb4874a53ab62bab1d93a7c7c"><h4 class="sectiontitle">Precautions</h4><ul id="EN-US_TOPIC_0000001188270562__uae1a8241c3474afe890855c0999c2360"><li id="EN-US_TOPIC_0000001188270562__l3dea34f4b0d644828bcb8975c92b31c5">The function is only available in maintenance mode (when GUC parameter <strong id="EN-US_TOPIC_0000001188270562__b84235270695538">xc_maintenance_mode</strong> is <strong id="EN-US_TOPIC_0000001188270562__b842352706144554">on</strong>). Exercise caution when enabling the mode. It is used by maintenance engineers for troubleshooting. Common users should not use the mode.</li><li id="EN-US_TOPIC_0000001188270562__l60b21d147c9846b2bd9ce05a536aa8ce">Only the transaction creators or system administrators can run the <strong id="EN-US_TOPIC_0000001188270562__b12045553115913">COMMIT</strong> command. The creation and commit operations must be in different sessions.</li><li id="EN-US_TOPIC_0000001188270562__lc1048422f6f84344a072710fe6ab59c4">The transaction function is maintained automatically by the database, and should be not visible to users.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001188270562__s3b4af498ff294065b18df50300e58b2b"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188270562__s72781e90417240548033db4d3725a6ab"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">COMMIT</span><span class="w"> </span><span class="n">PREPARED</span><span class="w"> </span><span class="n">transaction_id</span><span class="w"> </span><span class="p">;</span>
<span class="k">COMMIT</span><span class="w"> </span><span class="n">PREPARED</span><span class="w"> </span><span class="n">transaction_id</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="n">CSN</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188270562__s50429ccf90d14f34824b6a28e0cd633b"><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001188270562__ul1571718526216"><li id="EN-US_TOPIC_0000001188270562__li187173521528"><strong id="EN-US_TOPIC_0000001188270562__a1a331164b3554e9d8dca940cf0986f62">transaction_id</strong><p id="EN-US_TOPIC_0000001188270562__a5e92d693590b4e378c87ec5e2d29c6f8">Specifies the identifier of the transaction to be submitted. The identifier must be different from those for current prepared transactions.</p>
</li></ul>
<ul id="EN-US_TOPIC_0000001188270562__ul1187155520213"><li id="EN-US_TOPIC_0000001188270562__li1887119551422"><strong id="EN-US_TOPIC_0000001188270562__b17854104819212">CSN(commit sequence number)</strong><p id="EN-US_TOPIC_0000001188270562__p173875615285">Specifies the sequence number of the transaction to be committed. It is a 64-bit, incremental, unsigned number.</p>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001188270562__s4047b342f0354b9b97263f6453cc5943"><h4 class="sectiontitle">Helpful Links</h4><p id="EN-US_TOPIC_0000001188270562__ab68cd5febcf64be7acf08f2a0e102d68"><a href="dws_06_0262.html">PREPARE TRANSACTION</a>, <a href="dws_06_0268.html">ROLLBACK PREPARED</a></p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0254.html">TCL Syntax</a></div>
</div>
</div>