Can I roll back a SQLite transaction after it is committed?

Is there a way in SQLite to substantially undo the last transaction after it is completed?

I would like to return the database to a state before a transaction or savepoint. I looked at the rollback command, but it seems to be limited to rolling back the pending transaction.

Edit Can I create a savepoint with the name "Cancel" and wait for it to exit before the next action or rollback if I need to cancel it?

+4
source share
3 answers

I am not sure if you are using JDBC 3.0. If you are then, then it supports savepoints. http://www.ibm.com/developerworks/java/library/j-jdbcnew/

+2
source

Besides doing an online backup before your transaction, I don’t know that it supports a “time machine” to go back in time.

Could you set some application logic to write enough to cancel the operation being applied in the audit audit table (s)?

+1
source

I'm not an expert on SQLite, but as far as I tried, you can make savepoints inside transactions, but not vice versa.

And AFAIK, looking through online documentation, save points and transactions are almost the same, the difference is a transaction stack in which save points are written. You can open a certain number of savepoints (remembering the stack ordering), and after checking it “OK”, make a commit transaction. I do not know if this will help you.

0
source

All Articles