My SQLite
-based application currently uses transactions - both for being able to rollback and for improving performance. I'm considering replacing all transactions with savepoints. The reason is that the application is multi-threaded (yes, sqlite
is configured to be thread-safe), and in some cases a transaction might get started by two threads in the same time (on the same db).
- It there a reason NOT to do it?
- Are there any pitfalls I need to be aware of?
- Do I just replace
BEGIN
,COMMIT
,ROLLBACK
withSAVEPOINT xyz
,RELEASE SAVEPOINT xyz
,ROLLBACK TO SAVEPOINT xyz
?