fix db in wrong thread

Merged armin requested to merge fixDBinWrongThread into master

Merge request reports