Commit graph

12 commits

Author SHA1 Message Date
Daniel Kinzler
22aeca2dfe Merge "Replaced some !count() with explicit and more efficient check" 2012-10-17 18:02:58 +00:00
daniel
c546fae8ed merge latest master into Wikidata branch
Change-Id: Id4e0f40c03679c13d8934a6add99b5cd86d0437d
2012-10-08 13:58:54 +02:00
jeroendedauw
3910e91f78 Replaced some !count() with explicit and more efficient check
Change-Id: I004dbeb6fd00147979ca048d2b3f9f8adc04988a
2012-10-07 23:56:38 +02:00
jeroendedauw
430b31415f Replace remaining Array occurences with array
Change-Id: Id7c2fdd6814a8239acbe050d857b56350e691a49
2012-10-05 16:11:54 +02:00
daniel
b6fe213226 merge latest master.
some tests fail due to logical changes, will fix that in a follow-up

Change-Id: I8a5e4087ecf674fbcf6327c5d168cd401be12400
2012-09-05 17:50:13 +02:00
daniel
41f2132fe8 Make LinksUpdate run without a db transaction.
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
2012-08-27 14:32:06 +02:00
daniel
d87135d706 merged master
Change-Id: Iad12ee382d6aeb1fab6fefb611d290b74865ea4b
2012-07-23 22:07:18 +02:00
daniel
07e7a9c944 Tell people not to start transactions in doUpdate.
DataUpdate::runUpdates() object handle transations automatically,
code in doUpdate should not interfere with that.

Change-Id: I7575e1b77d58921813af24e015edb03cad5fdb3a
2012-07-12 16:56:07 -04:00
daniel
03046154cd Call new Content::prepareSave from WikiPage::doEditContent.
Content::prepareSave() is called  by WikiPage::doEditContent() inside the
transaction bracket for saving the new content, but before anything is actually
saved. This allows the content to first be normalized and checked against the
current database content; it also allows for some data to be written to the
database up front.

Change-Id: I78946ea5ec34dce08068692e2d77a8a0b7c11777
2012-06-27 09:42:49 +02:00
daniel
f08b275cae make SqlDataUpdate connect to database only when starting the transaction, not in the constructor 2012-06-13 12:30:55 +02:00
Alexandre Emsenhuber
3bbda787b8 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Ic1ba00472ef62fa4fd746f8f590fe694d490ecd9
2012-05-20 17:56:43 +02:00
daniel
a12ce17c6e Generalizing LinksUpdate to allow extensions to add arbitrary update handlers.
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
2012-05-13 20:53:37 +02:00