brion added a comment.
> This assumes the BlobStore will actually talk to the (same) database. I
would like to have Transaction separate from the DB stuff, so it can be used
just as well with files, or Cassandra, or Swift, or whatever we come up with to
store blobs. We shouldn't assume that it knows about SQL at all.
Quite so...
Let's try instead:
$dbw->transact(function($trx) use ($this, $dbw) {
// $trx is a Transaction obj managed by the Database object, which will
// have its commit or rollback callbacks triggered when Database\transact
reaches its end state
// ...
$url = $blobStore->saveBlob( $data, $trx );
// ...
});
// if we reach this far, the transaction successfully committed.
// otherwise it'll have thrown an exception
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