X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=blobdiff_plain;f=includes%2Fdb%2FDatabase.php;h=ad9a7e1078da526d8fc8f83ba545440fddc94f02;hb=5aafd0d136ee44391d7c92039180cc48a6fd2433;hp=df835290f40c0d4aa48eb341919428819b80dd89;hpb=21cd2ff45effc525044d7f649989d8714471344b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/db/Database.php b/includes/db/Database.php index df835290f4..ad9a7e1078 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -694,9 +694,6 @@ abstract class DatabaseBase implements IDatabase { } public function close() { - if ( count( $this->mTrxIdleCallbacks ) ) { // sanity - throw new MWException( "Transaction idle callbacks still pending." ); - } if ( $this->mConn ) { if ( $this->trxLevel() ) { if ( !$this->mTrxAutomatic ) { @@ -709,6 +706,8 @@ abstract class DatabaseBase implements IDatabase { $closed = $this->closeConnection(); $this->mConn = false; + } elseif ( $this->mTrxIdleCallbacks || $this->mTrxEndCallbacks ) { // sanity + throw new MWException( "Transaction callbacks still pending." ); } else { $closed = true; } @@ -2481,7 +2480,7 @@ abstract class DatabaseBase implements IDatabase { } /** - * Actually any "on transaction idle" callbacks. + * Actually run and consume any "on transaction idle" callbacks. * * @param integer $trigger IDatabase::TRIGGER_* constant * @since 1.20 @@ -2527,7 +2526,7 @@ abstract class DatabaseBase implements IDatabase { } /** - * Actually any "on transaction pre-commit" callbacks. + * Actually run and consume any "on transaction pre-commit" callbacks. * * This method should not be used outside of Database/LoadBalancer * @@ -2645,8 +2644,6 @@ abstract class DatabaseBase implements IDatabase { $this->mTrxAutomatic = false; $this->mTrxAutomaticAtomic = false; $this->mTrxAtomicLevels = []; - $this->mTrxIdleCallbacks = []; - $this->mTrxPreCommitCallbacks = []; $this->mTrxShortId = wfRandomString( 12 ); $this->mTrxWriteDuration = 0.0; $this->mTrxWriteCallers = [];