From: Aaron Schulz Date: Sat, 30 Jan 2016 16:52:06 +0000 (-0800) Subject: Make sure getScopedLockAndFlush() commits before unlocking X-Git-Tag: 1.31.0-rc.0~8138 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=4e62537a8b7aa6c74fad4c47afec73eef2417384;p=lhc%2Fweb%2Fwiklou.git Make sure getScopedLockAndFlush() commits before unlocking This is necessary for callers to see changes from prior callers Change-Id: I5e05215541e641b5b5a4bc55c91d6ec8ef774ca1 --- diff --git a/includes/db/Database.php b/includes/db/Database.php index dc1570e1a0..1836febf81 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -3174,6 +3174,7 @@ abstract class DatabaseBase implements IDatabase { $that = $this; $unlocker = new ScopedCallback( function () use ( $that, $lockKey, $fname ) { + $that->commit( __METHOD__, 'flush' ); $that->unlock( $lockKey, $fname ); } ); diff --git a/includes/db/IDatabase.php b/includes/db/IDatabase.php index 1a6e779329..1e728d80a1 100644 --- a/includes/db/IDatabase.php +++ b/includes/db/IDatabase.php @@ -1519,7 +1519,7 @@ interface IDatabase { * This is suitiable for transactions that need to be serialized using cooperative locks, * where each transaction can see each others' changes. Any transaction is flushed to clear * out stale REPEATABLE-READ snapshot data. Once the returned object falls out of PHP scope, - * the lock will be released. + * any transaction will be committed and the lock will be released. * * If the lock acquisition failed, then no transaction flush happens, and null is returned. *