Upgrade unmatched explicit commit() of DBO_TRX to an exception
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 11 Aug 2016 03:16:12 +0000 (20:16 -0700)
committerKrinkle <krinklemail@gmail.com>
Thu, 11 Aug 2016 07:12:44 +0000 (07:12 +0000)
Follows-up f8d5075656 and 820f5d6ce5.

This mostly for sanity, as normally the exception would
happen on begin().

Change-Id: I2c2fb20ed5184d3c00d3050e929a11e3e37f50f4

includes/db/Database.php

index ba25183..c591f3c 100644 (file)
@@ -2718,7 +2718,10 @@ abstract class DatabaseBase implements IDatabase {
                                wfWarn( "$fname: No transaction to commit, something got out of sync!" );
                                return; // nothing to do
                        } elseif ( $this->mTrxAutomatic ) {
-                               wfWarn( "$fname: Explicit commit of implicit transaction. Something may be out of sync!" );
+                               throw new DBUnexpectedError(
+                                       $this,
+                                       "$fname: Explicit commit of implicit transaction."
+                               );
                        }
                }