You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"COMMIT;" -> cannot commit - no transaction is active #583
Noticing some interesting messages in the output windows on Win64 with SQLCipher compiled in:
executeSQL: "COMMIT;" -> cannot commit - no transaction is active
As per screenshot:
The first three lines were output when setting the encryption key (File → Set Encryption).
The final '"COMMIT;" -> cannot commit' line is output any time the "Write Changes" button is pressed.
I haven't traced through the code to figure out what's going on, and the data appears at cursory glance to be getting written to disk, as the database can be re-opened to find the data there. However, this is something that bears looking into, just to be safe. 😉
Hi Justin!
I looked into this and fixed it. This was caused by an overcautious COMMIT when saving a database. We'd save all changes and then do an extra-commit just to be sure. But since there was no need for this, SQLite would output that warning. So this isn't caused by SQLCipher but would happen with the normal version, too. Good news is that this doesn't cause any harm at all, so no chance of this causing any data loss etc. I've fixed it anyway, so the warning should be gone. Instead of just deleting the COMMIT call (which should have been ok, too) we're now checking if there is still a transaction after saving everything, and only if there is we call COMMIT.
Tried this out again with the two latest commits applied. Yep, that last commit message - generated when clicking the "Write Changes" button - is no longer happening.
But 😄, found some other instances of it (and seemingly related).
This one is generated when creating a new database (non-encrypted). The message appears right after choosing a filename to save the database as:
The "RELEASE RESTOREPOINT;" line after that is generated when clicking "Write Changes", directly after creating an empty table (without changing to the "Browse Data" tab yet):
The third, fourth, and fifth lines are generated when the database file is closed. Seems like fairly standard widget output message stuff, and is hopefully easy to address. 😄
Activity
Don't do a COMMIT while saving when not in a transaction
MKleusberg commentedon May 5, 2016
Hi Justin!
I looked into this and fixed it. This was caused by an overcautious COMMIT when saving a database. We'd save all changes and then do an extra-commit just to be sure. But since there was no need for this, SQLite would output that warning. So this isn't caused by SQLCipher but would happen with the normal version, too. Good news is that this doesn't cause any harm at all, so no chance of this causing any data loss etc. I've fixed it anyway, so the warning should be gone. Instead of just deleting the COMMIT call (which should have been ok, too) we're now checking if there is still a transaction after saving everything, and only if there is we call COMMIT.
justinclift commentedon May 6, 2016
Awesome 😄, I'll verify it from my end probably tomorrow.
justinclift commentedon May 6, 2016
Tried this out again with the two latest commits applied. Yep, that last commit message - generated when clicking the "Write Changes" button - is no longer happening.
But 😄, found some other instances of it (and seemingly related).
This one is generated when creating a new database (non-encrypted). The message appears right after choosing a filename to save the database as:
The "RELEASE RESTOREPOINT;" line after that is generated when clicking "Write Changes", directly after creating an empty table (without changing to the "Browse Data" tab yet):
The third, fourth, and fifth lines are generated when the database file is closed. Seems like fairly standard widget output message stuff, and is hopefully easy to address. 😄
Avoid warning when creating new databases
MKleusberg commentedon May 8, 2017
@justinclift Should be fixed, too, now 😉 Can you double check?
justinclift commentedon May 8, 2017
Will do. Probably later today, but it may get pushed out to sometime this week depending on how other things go. 😉
MKleusberg commentedon Aug 13, 2017
Any update here? 😄
justinclift commentedon Aug 13, 2017
Ahhh, not yet. Haven't yet tried it, and it's not high enough up the priority list just atm. 😄
MKleusberg commentedon Aug 13, 2017
No worries 😉
mgrojo commentedon Oct 5, 2018
I've followed the steps and I don't reproduce the messages. But I get these in my case/version:
MKleusberg commentedon May 22, 2021
I'll just assume this is fixed 😄 At least I didn't notice any "cannot commit" messages for a long time.