*
* @note: do not assume that *other* IDatabase instances will be AUTOCOMMIT mode
*
- * The callback takes one argument:
+ * The callback takes the following arguments:
* - How the transaction ended (IDatabase::TRIGGER_COMMIT or IDatabase::TRIGGER_ROLLBACK)
+ * - This IDatabase instance (since 1.32)
*
* @param callable $callback
* @param string $fname Caller name
*
* @note: do not assume that *other* IDatabase instances will be AUTOCOMMIT mode
*
- * The callback takes one argument:
+ * The callback takes the following arguments:
* - How the transaction ended (IDatabase::TRIGGER_COMMIT or IDatabase::TRIGGER_IDLE)
+ * - This IDatabase instance (since 1.32)
*
* @param callable $callback
* @param string $fname Caller name
*
* Updates will execute in the order they were enqueued.
*
+ * The callback takes the one argument:
+ * - This IDatabase instance (since 1.32)
+ *
* @param callable $callback
* @param string $fname Caller name
* @since 1.22
* 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
* $dbw->endAtomic( __METHOD__ );
* } else {
* // Discard these writes from the transaction (preserving prior writes)
- * $dbw->cancelAtomic( __METHOD__ );
+ * $dbw->cancelAtomic( __METHOD__, $sectionId );
* }
* @endcode
*
* $this->blobStore->delete( $path );
* }
* },
- * },
- * __METHOD__
- * );
+ * __METHOD__
+ * );
+ * }, $dbw::ATOMIC_CANCELABLE );
* @endcode
*
* Example usage, caller of the "RecordStore::save" method:
* try {
* $recordStore->save( $record );
* } catch ( StoreFailureException $e ) {
- * $dbw->cancelAtomic( __METHOD__ );
* // ...various SQL writes happen...
* }
* // ...various SQL writes happen...