<!--
* 
*
*  ProLinga-Doc
*
*  Copyright (C) 2002-2008 Xobas Software.
*  All rights reserved.
*  
*  This file is part of ProLinga-Doc.
*
*  ProLinga-Doc is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  ProLinga-Doc is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with ProLinga-Doc.  If not, see <http://www.gnu.org/licenses/>.
*
*  More information is available at the following addresses:
*
*  Website     : http://www.prolinga.org
*
*  Email       : prolinga-list@prolinga.org
*
*
-->
<refentry id="cmd_transaction">
  <refmeta>
    <refentrytitle>TRANSACTION Command</refentrytitle>
    <manvolnum>1</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>TRANSACTION</refname>
    <refpurpose>Safeley execute SQL command within a transaction environment.</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>TRANSACTION</command>
      <arg choice='plain'><option>BEGIN</option></arg>
      <arg choice='plain'><replaceable>data_source_name</replaceable></arg>
      <arg choice='opt'>
        <arg choice='plain'><option>ISOLATION</option></arg>
        <group choice='req'>
          <arg choice='plain'><option>ReadCommitted</option></arg>
          <arg choice='plain'><option>ReadUncommitted</option></arg>
          <arg choice='plain'><option>RepeatableRead</option></arg>
          <arg choice='plain'><option>Serializable</option></arg>
          <arg choice='plain'><option>Unknown</option></arg>
        </group>
      </arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>TRANSACTION</command>
      <arg choice='plain'><option>COMMIT</option></arg>
      <arg choice='plain'><replaceable>data_source_name</replaceable></arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>TRANSACTION</command>
      <arg choice='plain'><option>ROLLBACK</option></arg>
      <arg choice='plain'><replaceable>data_source_name</replaceable></arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1 id="cmd_transaction_introduction">
    <title>Introduction</title>
    <para>
      The <link linkend="cmd_transaction">TRANSACTION</link> command provides
      a transaction environment where within SQL commands can be executed safeley.
      Transactions will only work if the underlying tables are transaction safe tables.
    </para>
  </refsect1>
  <refsect1 id="cmd_transaction_arguments">
    <title>Arguments</title>
    <variablelist>
      <varlistentry>
	<term><replaceable>data_source_name</replaceable></term>
	<listitem>
	  <simpara>
            The name of the data source as defined in the development environment.
	  </simpara>
	</listitem>
      </varlistentry>
    </variablelist>
    <note>
      In case no ISOLATION level has been entered, the default of
      Serializable will be used.
    </note>

  </refsect1>

  <refsect1 id="cmd_transaction_example">
    <title>Example</title>
<programlisting>
. . .
. . .
TRANSACTION BEGIN Order ISOLATION Serializable
. . .
. . .
TRANSACTION COMMIT Order
. . .
. . .
</programlisting>
  </refsect1>

  <refsect1 id="cmd_transaction_related">
    <title>Related Commands</title>
    <para>
      <link linkend="cmd_sql">SQL</link>
    </para>
  </refsect1>

</refentry>

