Initiates a transaction.

1 connection.begin

<connection.begin />

Remarks

Axional Studio XSQLScriptRunner initiates a transaction implicitly when it finds a DML statement <insert>, <update> or <delete>, and there is not a transaction in progress in the system.

Example

Initiates a transaction.

Copy
[...]
<connection.begin />
    <lock table='gvenmovh' mode='exclusive' />
    <lock table='gvenmovl' mode='exclusive' />
    <lock table='gvenmovm' mode='exclusive' />
    <update table='gvenmovh'>
       <column name='valstk'>N</column>
       <where>
           cabid IN (SELECT cabid FROM @tmp_ven)
       </where>
    </update>
    <update table='gvenmovl'>
       <column name='impcos'>0</column>
       <where>
           cabid IN (SELECT cabid FROM @tmp_ven)
       </where>
    </update>
<connection.commit />
[...]

Notas

It is initiated a transaction that includes locks on tables in exclusive mode and two registry update statements. The transaction ends by formalizing a COMMIT with the label <connection.commit>. A transaction can also be explicitly terminated with the tag <connection.rollback> or with the element <foreach> (assigning the value true to the autocommit attribute).