dbs Wed Aug 24 07:07:47 2005 EDT
Modified files:
/phpdoc/en/reference/pdo/functions PDO-beginTransaction.xml
PDO-rollBack.xml
Log:
Address bug 34231 (MySQL doesn't handle DDL in transactions).
http://cvs.php.net/diff.php/phpdoc/en/reference/pdo/functions/PDO-beginTransaction.xml?r1=1.3&r2=1.4&ty=u
Index: phpdoc/en/reference/pdo/functions/PDO-beginTransaction.xml
diff -u phpdoc/en/reference/pdo/functions/PDO-beginTransaction.xml:1.3
phpdoc/en/reference/pdo/functions/PDO-beginTransaction.xml:1.4
--- phpdoc/en/reference/pdo/functions/PDO-beginTransaction.xml:1.3 Mon Jul
11 00:38:55 2005
+++ phpdoc/en/reference/pdo/functions/PDO-beginTransaction.xml Wed Aug 24
07:07:44 2005
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc.
-->
<refentry id="function.PDO-beginTransaction">
<refnamediv>
@@ -19,15 +19,31 @@
<para>
Turns off autocommit mode. While autocommit mode is turned off, changes
made to the database via the PDO object instance are not committed until
- you end the transaction by calling either
- <function>PDO::commit</function> or <function>PDO::rollback</function>.
+ you end the transaction by calling <function>PDO::commit</function>.
+ Calling <function>PDO::rollback</function> will roll back all changes to
+ the database and return the connection to autocommit mode.
</para>
+ <para>
+ Some databases, including MySQL, automatically issue an implicit
+ COMMIT when a database definition language (DDL) statement such as
+ DROP TABLE or CREATE TABLE is issued within a transaction. The implicit
+ COMMIT will prevent you from rolling back any other changes within the
+ transaction boundary.
+ </para>
+
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example><title>Roll back a transaction</title>
+ <para>
+ The following example begins a transaction and issues two statements
+ that modify the database before rolling back the changes. On MySQL,
+ however, the DROP TABLE statement automatically commits the
+ transaction so that none of the changes in the transaction are rolled
+ back.
+ </para>
<programlisting role='php'>
<![CDATA[
<?php
http://cvs.php.net/diff.php/phpdoc/en/reference/pdo/functions/PDO-rollBack.xml?r1=1.5&r2=1.6&ty=u
Index: phpdoc/en/reference/pdo/functions/PDO-rollBack.xml
diff -u phpdoc/en/reference/pdo/functions/PDO-rollBack.xml:1.5
phpdoc/en/reference/pdo/functions/PDO-rollBack.xml:1.6
--- phpdoc/en/reference/pdo/functions/PDO-rollBack.xml:1.5 Mon Jul 11
00:38:55 2005
+++ phpdoc/en/reference/pdo/functions/PDO-rollBack.xml Wed Aug 24 07:07:45 2005
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc.
-->
<refentry id="function.PDO-rollBack">
<refnamediv>
@@ -26,12 +26,26 @@
If the database was set to autocommit mode, this function will restore
autocommit mode after it has rolled back the transaction.
</para>
+ <para>
+ Some databases, including MySQL, automatically issue an implicit
+ COMMIT when a database definition language (DDL) statement such as
+ DROP TABLE or CREATE TABLE is issued within a transaction. The implicit
+ COMMIT will prevent you from rolling back any other changes within the
+ transaction boundary.
+ </para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example><title>Roll back a transaction</title>
+ <para>
+ The following example begins a transaction and issues two statements
+ that modify the database before rolling back the changes. On MySQL,
+ however, the DROP TABLE statement automatically commits the
+ transaction so that none of the changes in the transaction are rolled
+ back.
+ </para>
<programlisting role='php'>
<![CDATA[
<?php