This causes LinksUpdate not to be wrapped by a transaction, fixing
a problem caused by the introduction of SqlDataUpdate. LinksUpdate
never used a transaction wrapping the entire update, but only small
transactions for some database operations. SqlDataUpdate however introduced
an implicite transaction bracket for the entire update, causing the old,
inner transactions to be nested transactions, which is unsupported and
may cause database corruption (because starting a "nested" transaction
will commit the previous transaction prematurely).
Once we have support for nested transactions, LinksUpdate may again use a
transaction bracket for the entire update, but this is also subject to
performance considerations.
Change-Id: I80faf2ed79b56a3990a1724516e65621ca5bbece
DataUpdate::runUpdates() object handle transations automatically,
code in doUpdate should not interfere with that.
Change-Id: I7575e1b77d58921813af24e015edb03cad5fdb3a
This supercedes I6d03bf2a, using better names for the new classes and
incorporating the changes requested by Aaron.
This change introduces the base class SecondaryDataUpdate to be used for any
updates that need to be applied when a page is changed or deleted. Until now,
this was done by the LinksUpdate class for updates and WikiPage::doDeletionUpdates
upon deletion. This patch uses a list of SecondaryDataUpdates in both cases.
This allows extensions (e.g. via the ContentHandler facility, once that is in) to
easily specify what needs to be done when a page is updated or deleted in order to
keep any secondary data stores (such as link tables) in sync.
Note that limited transactional logic is also introduced, so SecondaryDataUpdate
can be implemented to only commit their changes if all updates were performed
sucessfully.
Patch Set 2: fixing some coding style issues mentioned by Nikerabbit.
Patch Set 4: some stuff I kept from the old LinksUpdate class needs cleanup,
but might break extensions when changed. Marking as todo for now.
Patch Set 5: fixed misnamed member in LinksDeletionUpdate (thanks Aaron).
Change-Id: Ibe3e88fadd8c1d4063cf13bb6972f2a23569a73f