Use transactions within SqliteStorage backend
At the moment, the SqliteStorage backend does not support transactions. Unfortunately, adding logDb.transaction() at the necessary places does not help. The problem is, that prepared statements (probably SELECT statements only) seem to stay active until they are cleared/deleted. And Sqlite cannot commit while active statements exist.
So if we don't find a better way, we will probably have to get rid of prepared statements.
#1 Updated by EgS about 15 years ago
Actually we just got rid of the transactions. :)
In Sqlite Transactions are only helpflul to execute multiple statements as one atomic transaction. This is helpful in 2 cases:
1.) while a previous insert/update/delete was successfull a succeding statement might fail. In this case a rollback is quite handsome. The maximum depth used in our database is about 3 which can easily be managed manualy.
2.) concurrent access. Since the backend itself is singlethreaded and multiclient access to the sqlite database itself is not allowed this does not concern us.
Preparedstatements allows a speedup when executing the same statement multiple times. Since this is a chatclient we might have a lot of incoming data and thus lots of inserts. Therefore transactions have been removed.