Author: jstephens
Date: 2007-04-19 00:35:56 +0200 (Thu, 19 Apr 2007)
New Revision: 5993
Log:
In 5.1.16+, NdbTransaction::execute() returns -1 IFF the transaction
actually failed.
(Fixes Docs Bug #27852)
Modified:
trunk/ndbapi/ndb-classes.xml
trunk/refman-5.1/news-5.1.xml
Modified: trunk/ndbapi/ndb-classes.xml
===================================================================
--- trunk/ndbapi/ndb-classes.xml 2007-04-18 21:59:45 UTC (rev 5992)
+++ trunk/ndbapi/ndb-classes.xml 2007-04-18 22:35:56 UTC (rev 5993)
Changed blocks: 1, Lines Added: 43, Lines Deleted: 0; 1743 bytes
@@ -36518,7 +36518,50 @@
</para>
</formalpara>
+
+ <para>
+ In MySQL 5.1.15 and earlier versions, this method returned
+ <literal>-1</literal> for some errors even when the
+ trasnsaction itself was not aborted; beginning with MySQL
+ 5.1.16, this method reports a failure <emphasis>if and only
+ if</emphasis> the transaction was aborted. (This change was
+ made due to the fact it had been possible to construct cases
+ where there was no way to determine whether or not a
+ transaction was actually aborted.) However, the transaction's
+ error information is still set in such cases to reflect the
+ actual error code and category.
+ </para>
+
+ <para>
+ This means, in the case where a
+ <errorname>NoDataFound</errorname> error is a possibility, you
+ must now check for it explicitly, for example:
+
+<programlisting>
+Ndb_cluster_connection myConnection;
+if( myConnection.connect(4, 5, 1) )
+{
+ cout << "Unable to connect to cluster within 30 secs." << endl;
+ exit(-1);
+}
+
+Ndb myNdb(&myConnection, "test");
+
+// define operations...
+
+myTransaction = myNdb->startTransaction();
+
+if(myTransaction->getNdbError().classification == NdbError:NoDataFound)
+{
+ cout << "No records found." << endl;
+ // ...
+}
+
+myNdb->closeTransaction(myTransaction);
+</programlisting>
+ </para>
+
<!--
<formalpara>
Modified: trunk/refman-5.1/news-5.1.xml
===================================================================
--- trunk/refman-5.1/news-5.1.xml 2007-04-18 21:59:45 UTC (rev 5992)
+++ trunk/refman-5.1/news-5.1.xml 2007-04-18 22:35:56 UTC (rev 5993)
Changed blocks: 1, Lines Added: 7, Lines Deleted: 2; 1029 bytes
@@ -2557,10 +2557,15 @@
<literal>NdbTransaction::AbortOption</literal> can no longer
be used, and applications written against the NDB API may need
to be rewritten and recompiled to accomodate these changes.
+ For more information about this change, see
+ <xref linkend="class-ndboperation-abortoption"/>.
</para>
-
+
<para>
- See <xref linkend="class-ndboperation-abortoption"/>, for more
+ This also affects the behavior of the
+ <literal>NdbTransaction::execute()</literal> method, which now
+ reports failure only if the transaction was actually aborted.
+ See <xref linkend="class-ndbtransaction-execute"/>, for more
information.
</para>
</listitem>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r5993 - in trunk: ndbapi refman-5.1 | jon | 19 Apr |