Add some locks in SQLite to ensure the transactions are in the correct order This is the only way to fix some synchronization issues in SQLite as it's single-threaded by default. You can use other file-based storage types like FLAT, YAML or JSON, or setup a MYSQL database as it supports multi-threaded properly.