doc-exports/docs/dws/dev/dws_06_0260.html
Lu, Huayi ef0ada5a59 DWS DEV 20240716 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-11-02 09:07:47 +00:00

28 lines
3.8 KiB
HTML

<a name="EN-US_TOPIC_0000001510282149"></a><a name="EN-US_TOPIC_0000001510282149"></a>
<h1 class="topictitle1">COMMIT PREPARED</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001510282149__sd1b72db9ad7a48b78f0b0d7f17cecc2a"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001510282149__a7e77b7d4471f4687bef955c27b74977f">Commits a prepared two-phase transaction.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001510282149__s92531e7eb6004f5da9d1a031cdbbecb7"><h4 class="sectiontitle">Precautions</h4><ul id="EN-US_TOPIC_0000001510282149__u3b18dac7146146a68945ed0a205f0e31"><li id="EN-US_TOPIC_0000001510282149__l3e93b36dff214e7ba8f3e422b0b4111e">The function is available only in maintenance mode (when GUC parameter <strong id="EN-US_TOPIC_0000001510282149__b63558950452411">xc_maintenance_mode</strong> is <strong id="EN-US_TOPIC_0000001510282149__b65846852652411">on</strong>). It is usually used by maintenance engineers for troubleshooting. Common users should not use this mode.</li><li id="EN-US_TOPIC_0000001510282149__l14df7c1f6c834c10be43614a7d0ba71b">Only the transaction creators or system administrators can run the <strong id="EN-US_TOPIC_0000001510282149__b15496917154310">COMMIT</strong> command. The creation and commit operations must be in different sessions.</li><li id="EN-US_TOPIC_0000001510282149__lffca42be942f436faf799ad4d1db6a17">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_0000001510282149__sfdf77bf2fd0f48c7931bc50968220d45"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001510282149__s06498f6d6a984fd4943494ed2b986c7e"><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_0000001510282149__sc630249cddaf45eb9d18f655160fdf77"><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001510282149__ul1571718526216"><li id="EN-US_TOPIC_0000001510282149__li187173521528"><strong id="EN-US_TOPIC_0000001510282149__a7f72aa786fbe45378f326a84ce615abd">transaction_id</strong><p id="EN-US_TOPIC_0000001510282149__a13909323d0984cfaa69257f692d5eb4d">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_0000001510282149__ul1187155520213"><li id="EN-US_TOPIC_0000001510282149__li1887119551422"><strong id="EN-US_TOPIC_0000001510282149__b17854104819212">CSN(commit sequence number)</strong><p id="EN-US_TOPIC_0000001510282149__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_0000001510282149__s9416198525d04f7e90a111ce2d449241"><h4 class="sectiontitle">Helpful Links</h4><p id="EN-US_TOPIC_0000001510282149__a15626689341443b0b2e6f0ec526ae6b0"><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>