Item14435: Use DB transactions
Current State: Confirmed
Released In: n/a
Topic insertion is not atomic (it doesn't use transactions). So if it fails for any reason, we have to be sure to undo any changes done up to that point.
If a topic insertion fails, then the rollback record only records the insertion into the topic table, it doesn't record the insertion into the meta tables. So if the insertion fails, it will take out the topic without taking out the meta.
If the failure occurs while inserting into one of the meta tables with a unique key constraint, the effect is cumulative.
Need to add an undo for the tables as well. Or, in a future life, use transactions. And possibly DB-specific support for unique IDs (they all do it differently
- 14 Jul 2017
This is working for now with the undo, but really need to re-code to use transactions so leaving open and changing title from "Failed topic insertion can kill the DB" and priority from "Urgent"
- 31 Aug 2017 - 10:58