[bug 1110653] Avoid db deadlocks when updating events.
Merge pull request #887 from akatsoulas/1110653-db-deadlocks

[bug 1110653] Avoid db deadlocks when updating events.