From: Aaron Schulz Date: Fri, 13 Apr 2018 22:25:28 +0000 (-0700) Subject: rdbms: correct atomic section examples in comments X-Git-Tag: 1.31.0-rc.0~22^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=e9602b246640c4878036e1d27b7f71704ec4bf53;hp=bae2b9d95c885ad78f3a0263af4e9643dc4783e6;ds=sidebyside rdbms: correct atomic section examples in comments Follow-up to f0f4f5f5b820 Change-Id: I0402be7942f615f3e6f7ee3edd6f7b356a6bc3ef (cherry picked from commit d1e70af98d46cb16b8e77c7d11ced16cfdd80d8b) --- diff --git a/includes/libs/rdbms/database/IDatabase.php b/includes/libs/rdbms/database/IDatabase.php index b50ff70617..675ba7f2bc 100644 --- a/includes/libs/rdbms/database/IDatabase.php +++ b/includes/libs/rdbms/database/IDatabase.php @@ -1601,7 +1601,7 @@ interface IDatabase { * Example usage (atomic changes that might have to be discarded): * @code * // Start a transaction if there isn't one already - * $dbw->startAtomic( __METHOD__, $dbw::ATOMIC_CANCELABLE ); + * $sectionId = $dbw->startAtomic( __METHOD__, $dbw::ATOMIC_CANCELABLE ); * // Create new record metadata row * $dbw->insert( 'records', $row, __METHOD__ ); * // Figure out where to store the data based on the new row's ID @@ -1622,7 +1622,7 @@ interface IDatabase { * $dbw->endAtomic( __METHOD__ ); * } else { * // Discard these writes from the transaction (preserving prior writes) - * $dbw->cancelAtomic( __METHOD__ ); + * $dbw->cancelAtomic( __METHOD__, $sectionId ); * } * @endcode * @@ -1714,9 +1714,9 @@ interface IDatabase { * $this->blobStore->delete( $path ); * } * }, - * }, - * __METHOD__ - * ); + * __METHOD__ + * ); + * }, $dbw::ATOMIC_CANCELABLE ); * @endcode * * Example usage, caller of the "RecordStore::save" method: @@ -1726,7 +1726,6 @@ interface IDatabase { * try { * $recordStore->save( $record ); * } catch ( StoreFailureException $e ) { - * $dbw->cancelAtomic( __METHOD__ ); * // ...various SQL writes happen... * } * // ...various SQL writes happen...