Make onTransactionPreCommitOrIdle() atomic when immediate
authorAaron Schulz <aschulz@wikimedia.org>
Sun, 24 Jul 2016 18:22:59 +0000 (11:22 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 25 Jul 2016 19:15:31 +0000 (12:15 -0700)
commit21cd2ff45effc525044d7f649989d8714471344b
tree6b303b5e81e3c0983d8f8a82c2409383e83ca54a
parent9ffc40235b926e9280bae432908214c9cae045f3
Make onTransactionPreCommitOrIdle() atomic when immediate

One of the main uses of this method is to tack on some DB
updates to the end of atomic transactions to reduce lock
contention problems. In this case, multiple updates in the
callback are atomic. However, if no transaction is active,
then such updates were previously not atomic. Wrap them in
transactions now.

Change-Id: I18c56e65063a61000c4dfd1979bf972800b173ac
includes/db/Database.php
includes/db/IDatabase.php