forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
22 lines
3.2 KiB
HTML
22 lines
3.2 KiB
HTML
<a name="EN-US_TOPIC_0000001145510989"></a><a name="EN-US_TOPIC_0000001145510989"></a>
|
|
|
|
<h1 class="topictitle1">Controlling Transactions</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001145510989__en-us_topic_0059777755_p841213161455">A transaction is a user-defined sequence of database operations, which form an integral unit of work.</p>
|
|
<div class="section" id="EN-US_TOPIC_0000001145510989__s7114764dc21248f6a3a0c905b8d113f2"><h4 class="sectiontitle">Starting Transactions</h4><p id="EN-US_TOPIC_0000001145510989__a29c0da23b9fb4362b230b8927077f504"><span id="EN-US_TOPIC_0000001145510989__text639540340">GaussDB(DWS)</span> starts a transaction using <strong id="EN-US_TOPIC_0000001145510989__en-us_topic_0085032285_b177501937185016">START TRANSACTION</strong> and <strong id="EN-US_TOPIC_0000001145510989__en-us_topic_0085032285_b19750153725016">BEGIN</strong>. For details, see <a href="dws_06_0265.html">START TRANSACTION</a> and <a href="dws_06_0257.html">BEGIN</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001145510989__sbfe6ccaa908b44149e3eec261e822ba6"><h4 class="sectiontitle">Setting Transactions</h4><p id="EN-US_TOPIC_0000001145510989__a924e080f6ce14e3d9fe81f63128c74e1"><span id="EN-US_TOPIC_0000001145510989__text1094304765">GaussDB(DWS)</span> sets a transaction using <strong id="EN-US_TOPIC_0000001145510989__en-us_topic_0085032285_b8859796511">SET TRANSACTION</strong> or <strong id="EN-US_TOPIC_0000001145510989__en-us_topic_0085032285_b38598995113">SET LOCAL TRANSACTION</strong>. For details, see <a href="dws_06_0264.html">SET TRANSACTION</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001145510989__s417f5bdb881d4db6bb2a0094ce8e5836"><h4 class="sectiontitle">Submitting Transactions</h4><p id="EN-US_TOPIC_0000001145510989__ac7a27389578344f3be3a5f4c572c61e6"><span id="EN-US_TOPIC_0000001145510989__text1879393406">GaussDB(DWS)</span> commits all operations of a transaction using <strong id="EN-US_TOPIC_0000001145510989__en-us_topic_0085032285_b25478269511">COMMIT</strong> or <strong id="EN-US_TOPIC_0000001145510989__en-us_topic_0085032285_b1854712613513">END</strong>. For details, see <a href="dws_06_0259.html">COMMIT | END</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001145510989__s6b8cb88be9b043a8b5065bc2facda7f7"><h4 class="sectiontitle">Rolling Back Transactions</h4><p id="EN-US_TOPIC_0000001145510989__ab58069b9c75842b5ab9023b11bb52e04">If a fault occurs during a transaction and the transaction cannot proceed, the system performs rollback to cancel all the completed database operations related to the transaction. For details, see <a href="dws_06_0266.html">ROLLBACK</a>.</p>
|
|
<div class="note" id="EN-US_TOPIC_0000001145510989__note82203423570"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001145510989__p192201342185719">If an execution request (not in a transaction block) received in the database contains multiple statements, the statements will be packed into a transaction. If one of the statements fails, the entire request will be rolled back.</p>
|
|
</div></div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_2000.html">SQL Syntax Reference</a></div>
|
|
</div>
|
|
</div>
|
|
|