/**
* Basic database interface for live and lazy-loaded relation database handles
*
- * @note: IDatabase and DBConnRef should be updated to reflect any changes
+ * @note IDatabase and DBConnRef should be updated to reflect any changes
* @ingroup Database
*/
interface IDatabase {
$tables, $var = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
);
+ /**
+ * Lock all rows meeting the given conditions/options FOR UPDATE
+ *
+ * @param array|string $table Table names
+ * @param array|string $conds Filters on the table
+ * @param string $fname Function name for profiling
+ * @param array $options Options for select ("FOR UPDATE" is added automatically)
+ * @param array $join_conds Join conditions
+ * @return int Number of matching rows found (and locked)
+ * @since 1.32
+ */
+ public function lockForUpdate(
+ $table, $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
+ );
+
/**
* Determines whether a field exists in a table
*
*
* This is useful for combining cooperative locks and DB transactions.
*
- * @note: do not assume that *other* IDatabase instances will be AUTOCOMMIT mode
+ * @note do not assume that *other* IDatabase instances will be AUTOCOMMIT mode
*
* The callback takes the following arguments:
* - How the transaction ended (IDatabase::TRIGGER_COMMIT or IDatabase::TRIGGER_ROLLBACK)
*
* Updates will execute in the order they were enqueued.
*
- * @note: do not assume that *other* IDatabase instances will be AUTOCOMMIT mode
+ * @note do not assume that *other* IDatabase instances will be AUTOCOMMIT mode
*
* The callback takes the following arguments:
* - How the transaction ended (IDatabase::TRIGGER_COMMIT or IDatabase::TRIGGER_IDLE)
* - The failures are from contention solvable via onTransactionPreCommitOrIdle()
* - The failures are deadlocks; the RDBMs usually discard the whole transaction
*
- * @note: callers must use additional measures for situations involving two or more
+ * @note callers must use additional measures for situations involving two or more
* (peer) transactions (e.g. updating two database servers at once). The transaction
* and savepoint logic of this method only applies to this specific IDatabase instance.
*
* corresponding startAtomic() implicitly started a transaction, that
* transaction is rolled back.
*
- * @note: callers must use additional measures for situations involving two or more
+ * @note callers must use additional measures for situations involving two or more
* (peer) transactions (e.g. updating two database servers at once). The transaction
* and savepoint logic of startAtomic() are bound to specific IDatabase instances.
*