brion added a comment.
In https://phabricator.wikimedia.org/T107595#2264334, @daniel wrote: > We could (optionally?) provide a transaction context to the blob store like this: I kinda like that, yeah. Maybe extend Database with a transactional interface that takes a callback: $dbw->transaction(function() use ($this, $dbw) { // blah blah blah }); // if we reach this far, the transaction successfully committed. // otherwise it'll have thrown an exception and internally in the BlobStore's save method, we add the rollback callback straight onto the db object: $dbw->addRollbackCallback( function() use ( $url ) { $this->delete( $url ); } ) That avoids having transaction state live separately in both the connection and a Transaction object. Good model? Bad model? TASK DETAIL https://phabricator.wikimedia.org/T107595 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: daniel, brion Cc: JJMC89, RobLa-WMF, Yurik, ArielGlenn, APerson, TomT0m, Krenair, intracer, Tgr, Tobi_WMDE_SW, Addshore, Lydia_Pintscher, cscott, PleaseStand, awight, Ricordisamoa, GWicke, MarkTraceur, waldyrious, Legoktm, Aklapper, Jdforrester-WMF, Ltrlg, brion, Spage, MZMcBride, daniel, D3r1ck01, Izno, Luke081515, Wikidata-bugs, aude, jayvdb, fbstj, Mbch331, Jay8g, bd808 _______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
