protected function runOnTransactionIdleCallbacks() {
$autoTrx = $this->getFlag( DBO_TRX ); // automatic begin() enabled?
- $e = null; // last exception
+ $e = $ePrior = null; // last exception
do { // callbacks may add callbacks :)
$callbacks = $this->mTrxIdleCallbacks;
$this->mTrxIdleCallbacks = array(); // recursion guard
call_user_func( $phpCallback );
$this->setFlag( $autoTrx ? DBO_TRX : 0 ); // restore automatic begin()
} catch ( Exception $e ) {
+ if ( $ePrior ) {
+ MWExceptionHandler::logException( $ePrior );
+ }
+ $ePrior = $e;
}
}
} while ( count( $this->mTrxIdleCallbacks ) );
* @since 1.22
*/
protected function runOnTransactionPreCommitCallbacks() {
- $e = null; // last exception
+ $e = $ePrior = null; // last exception
do { // callbacks may add callbacks :)
$callbacks = $this->mTrxPreCommitCallbacks;
$this->mTrxPreCommitCallbacks = array(); // recursion guard
list( $phpCallback ) = $callback;
call_user_func( $phpCallback );
} catch ( Exception $e ) {
+ if ( $ePrior ) {
+ MWExceptionHandler::logException( $ePrior );
+ }
+ $ePrior = $e;
}
}
} while ( count( $this->mTrxPreCommitCallbacks ) );