27 if ( $this->dbw->trxLevel() ) {
28 $this->dbw->onTransactionResolution( [ $this,
'cancelOnRollback' ],
$fname );
33 if ( !$this->callback ) {
37 $autoTrx = $this->dbw->getFlag(
DBO_TRX );
38 $this->dbw->clearFlag(
DBO_TRX );
42 call_user_func_array( $this->callback, [ $this->dbw, $this->fname ] );
43 }
catch ( Exception
$e ) {
54 if ( $trigger === IDatabase::TRIGGER_ROLLBACK ) {
55 $this->callback =
null;
Deferrable Update for closure/callback updates that should use auto-commit mode.
__construct(IDatabase $dbw, $fname, callable $callback)
doUpdate()
Perform the actual work.
cancelOnRollback( $trigger)
returning false will NOT prevent logging $e
Callback wrapper that has an originating method.
Interface that deferrable updates should implement.