jeudi 19 février 2015

Write to SQLite DB while transaction in another connection is opened

I have a Firefox add-on which uses SQLite DB to store data (with a help of wrapper around mozIStorageConnection. Data is displayed and manipulated with in a separate dialog. To be able to cancel changes in DB I use beginTransaction/commitTransaction/rollbackTransaction methods, so that transaction is opened when dialog is shown and committed/rolled back when dialog is closed.


Now there's a need for some portion of data to be saved to DB without losing it when dialog is cancelled. I've tried using another connection but write is suspended so that callbacks for handling query completion aren't called but data is saved to DB when dialog is opened again and saved data is displayed.


Is it possible to commit data to DB while transaction is opened in another connection. Doc entry here says it's not possible but I'm not sure if it's meant for one connection or any number of them?


Aucun commentaire:

Enregistrer un commentaire