forked from openlp/openlp
913b0433f6
Changes are made due to the following issues: - the code assumed that exception OperationalError would only be thrown by mySQL temporarily disappearing. However, other dbms can throw this exception and usually for errors that mean a retry will also fail. - the code repeated the actual code of the method within the exception handler. This means code duplication and also that any new exceptions are not handled by the same exception handler so for example their transaction will not get rolled back. - not all potential dbms exceptions were caught and so in some cases the database transaction was not rolled back The solution is to retry transactions where an OperationalError is thrown. Currently these are retried up to 3 times before the error is logged and the method returns false. By retrying the transaction we ensure that the same transaction code with the same exception handlers is used each time. An additional catchall exception has been added where there is a transaction to ensure that it is rolled back. As with the OperationError this throws the exception back up the stack. |
||
---|---|---|
.. | ||
core | ||
plugins | ||
.version | ||
__init__.py |