[WriteTransaction] Make WriteTransaction a subclass of Transaction
This patch refactors Transaction / WriteTransaction code. It solves following issues:
- Checks whether one is allowed to perform write operations on DB are
performed at compile time instead of having bug-prone asserts.
Now one has to use
Transaction
for read-only access andWriteTransaction
for read-write access. - All modify operations are moved to
WriteTransaction
. PreviouslyTransaction
contained some code which actually modified the DB (setPhaseOne
,removePhaseOne
andaddFailed
), which contradicted the original idea of separation read-only and read-write access by having two classes. - It also allows to simplify the
Transaction
code and drop shallow write-related proxy-methods that forwarded those calls toWriteTransaction
.
Edited by Igor Poboiko