1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2018 OpenLink Software
-
- This project 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; only version 2 of the License, dated June 1991.
-
- This program 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 this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-->
<refentry id="fn_log_enable">
<refmeta>
<refentrytitle>log_enable</refentrytitle>
<refmiscinfo>admin</refmiscinfo>
</refmeta>
<refnamediv>
<refname>log_enable</refname>
<refpurpose>controls transaction logging and in-statement autocommit</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="fsyn_log_enable">
<funcprototype id="fproto_log_enable">
<funcdef><function>log_enable</function></funcdef>
<paramdef>in <parameter>bits</parameter> integer</paramdef>
<paramdef><optional>in <parameter>quiet</parameter> integer</optional></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="desc_log_enable"><title>Description</title>
<para>The <function>log_enable</function> function allows turning off or on
regular transaction logging or autocommit after every changed row.
The parameter <parameter>bits</parameter> is a bitmask.
Two bits that are in use in current versions are 1 and 2.
When bit 1 is not set (e.g. parameter value 0) then the function call
terminates logging of DML statements inside the calling
transaction. A value of 1 resumes logging of DML statements.
If bit 2 is set then automatic commits take place after every change
in every row in every DML statement.
Thus a parameter value of 2 disables logging and enables row-by-row autocommit.
A value of 3 enables row-by-row autocommit and enables logging.
While log on and off setting alone is reset at the end of the transaction so that one does not end up with logging disabled by accident,
the row-by-row autocommit mode causes the setting to be permanent inside the calling connection or web request.
That is, for a SQL client the setting stays in effect until changed or disconnected and for a web request it stays in effect until the request is completed.
</para>
<para>
The function do nothing if the <parameter>bits</parameter> is NULL.
The function also do nothing when called inside atomic section.
</para>
<para>The function always returns the bitmask that describes old configuration of the log.</para>
<para>Attempt to disable transaction log that is disabled already result in an error.
If the second parameter is passed and it is not equal to zero then the error is
suppressed (and it's still possible to turn on or off autocommit).</para>
<para>Using this function one can create situations where a transaction's outcome
would be different from the outcome of doing a roll forward of the
transaction log.</para>
<para>There are rare cases where it is more efficient to log an action in
the form of a procedure call instead of logging the effects of the procedure on
a row by row basis. This is similar in concept to replicating procedure
calls but applies to roll forward instead.</para>
</refsect1>
<refsect1 id="seealso_log_enable"><title>See Also</title>
<para><link linkend="fn_log_text"><function>log_text</function></link></para>
</refsect1>
</refentry>
|