Releases: cachapa/sql_crdt
Releases · cachapa/sql_crdt
0.0.6
0.0.5+1
0.0.5
0.0.4
0.0.3: Major refactor to fix transaction deadlocks
So it turns out there's a good reason why Sqflite has a transaction helper method: Sqlite doesn't like it when you try to open more than one transaction. Making sure you only have one transaction at any time can be difficult in non-trivial code. sqlite_crdt also uses transactions internally for some of its own operations which makes it even harder to avoid collisions. A better solution is to make transactions blocking, that way you can ensure there's only one transaction running at any time, and subsequent transactions will just wait for the previous to finish. I tried to do that in a previous commit, but that's not easy to get right because exceptions could exit transactions without releasing the lock. Moreover the code which prevented incrementing the canonical time inside transactions got a bit messy. This commit fixes that by using different classes for the different use cases: * BaseCrdt only intercepts create statements * TransactionCrdt appends an immutable hlc to write statements * SqliteCrdt does everything + watches, merges, hlc increments, etc. Moreover, it now uses the Sqflite transaction method to benefit from the existing blocking transaction implementation.