Skip to content

Cannot modify database - No Such Savepoint #836

Open

Description

@chrisjlocke

Details for the issue

Using the latest nightly. Created a database fine. However, if I edit a table and click 'Write Changes', an error is displayed.
Interestingly, the changes are saved. Closing the database and re-opening it contains the modifications made.

image

Useful extra information

I'm opening this issue because:

  • DB4S is crashing
  • DB4S has a bug
  • DB4S needs a feature
  • DB4S has another problem

I'm using DB4S on:

  • Windows: ( version: 10 (64bit)_ )
  • Linux: ( distro: ___ )
  • Mac OS: ( version: ___ )
  • Other: ___

I'm using DB4S version:

  • 3.9.1
  • 3.9.0
  • Other: 3.9.99 (64bit)_

I have also:

Activity

  1. justinclift commented on Oct 18, 2016

    @justinclift
    Member

    Interesting. Sounds like a side effect of e76e5b3.

    @MKleusberg Probably of interest to you? 😄

  2. added
    bugConfirmed bugs or reports that are very likely to be bugs.
    on Oct 18, 2016
  3. chrisjlocke commented on Oct 18, 2016

    @chrisjlocke
    MemberAuthor

    Just an additional note too that clicking 'Close Database' and selecting 'Yes' to the 'Do you want to save changes?' doesn't display an error. I guess that means that way of closing a database either isn't saving the savepoints like the 'Write Changes' button, or if it is, its not displaying any errors...

  4. added a commit that references this issue on Dec 10, 2016
  5. added 2 commits that reference this issue on Dec 29, 2016
  6. NicoDupont commented on Apr 29, 2017

    @NicoDupont

    Hi everyone,
    I exactly have the same issue on my installation (Ubuntu 16.04 64b)
    Version 3.9.99
    Version de Qt : 5.5.1
    Version de SQLite : 3.11.0

  7. chrisjlocke commented on Apr 29, 2017

    @chrisjlocke
    MemberAuthor

    V3.9.99 means it's a nightly build. What's the date of this version (file modified date)
    Have you tried one of the latest nightlies?

  8. NicoDupont commented on Apr 29, 2017

    @NicoDupont

    It seems I'm on the testing ppa "ubuntu xenial"
    where I can see the file modified date ?
    Thank you

  9. justinclift commented on Apr 29, 2017

    @justinclift
    Member

    Hmmm, looking at the testing ppa listing:

        https://launchpad.net/~linuxgndu/+archive/ubuntu/sqlitebrowser

    It seems to be saying the last build was 2016-08-24.

    @NicoDupont You may need to attempt building from source yourself. It should go fine, but if it doesn't then cut-n-paste any error message here and we'll probably be able to help. 😄

  10. justinclift commented on Apr 29, 2017

    @justinclift
    Member

    Oops, no. I was looking at the "stable" one. The testing one says it's last build was an hour ago:

        https://launchpad.net/~linuxgndu/+archive/ubuntu/sqlitebrowser-testing

    This might still be a bug we need to look into then.

  11. justinclift commented on Apr 29, 2017

    @justinclift
    Member

    @NicoDupont Does the error occur for often / all the time, or just sometimes, or ? If it happens often, is there a way to reliably trigger it?

  12. 20 remaining items

  13. chrisjlocke commented on Aug 29, 2019

    @chrisjlocke
    MemberAuthor
  14. chrisjlocke commented on Aug 29, 2019

    @chrisjlocke
    MemberAuthor
  15. AndrewMcSwain commented on Nov 23, 2019

    @AndrewMcSwain

    I'm getting this error while trying to save my edits to the 'Network Activity Predictor' db of Chrome. I'm on Windows 8.

  16. rrakso commented on Nov 3, 2020

    @rrakso

    I have also this problem. While trying to delete an record from sqlite DB 😞

  17. chrisjlocke commented on Nov 3, 2020

    @chrisjlocke
    MemberAuthor

    Can you close DB4S, try again, and if it occurs, let me know what steps you're doing.
    Also, I don't know what version of DB4S you're using - can you provide that information?
    Also, what operating system are you using?

  18. frapeshka commented on Feb 25, 2021

    @frapeshka

    Same issue, Linux, Debian.

  19. chrisjlocke commented on Feb 25, 2021

    @chrisjlocke
    MemberAuthor

    What version of DB4S are you using?

  20. frapeshka commented on Feb 26, 2021

    @frapeshka

    What version of DB4S are you using?

    Version 3.10.1
    Qt Version 5.9.3
    SQLite Version 3.21.0
    It's not crucial, I just restarted the app and the problem gone.

  21. raffaelemancuso commented on Jul 19, 2021

    @raffaelemancuso

    I have just stumbled upon this:

    image

    How can I fix the problem?

    Will my edits be saved if I exit from the db?

  22. chrisjlocke commented on Jul 19, 2021

    @chrisjlocke
    MemberAuthor

    What version of DB4S are you using? What operating system? What were you doing to cause this? If you try it again, does it occur again?

  23. raffaelemancuso commented on Jul 19, 2021

    @raffaelemancuso

    I am using 3.12.2 on Fedora Workstation 34. I installed from the Fedora repositories, since the AppImage doesn't work.

    I don't know how to reproduce it ... maybe interrupt a query in the middle? Something like this

  24. vilhok commented on Apr 17, 2023

    @vilhok

    I also encounter this when working with transactions.

    To reproduce: first, create a table:

    DROP TABLE IF EXISTS accounts;
    CREATE TABLE "accounts" (
    	"accountnum"	INTEGER,
    	"money"	INTEGER NOT NULL,
    	CHECK (money >= 0), 
    	PRIMARY KEY("accountnum")
    );
    
    INSERT INTO accounts VALUES(123,500);
    INSERT INTO accounts VALUES(456,500);

    At this point, you can click "Write Changes"

    Then, run following:

    BEGIN TRANSACTION;
    
    INSERT INTO accounts VALUES(123456,100);
    
    SELECT * FROM accounts;

    You can observe that the insert has been done succesfully.

    Then, run:

    ROLLBACK;
    
    SELECT * FROM accounts;

    You can now observe that the ROLLBACK was effective.

    Try to click "Write Changes" you get the error dialog for no such savepoint: RESTOREPOINT (RELEASE "RESTOREPOINT";)

    Useful info:

    $ sqlitebrowser -v
    DB Browser for SQLite Version 3.12.2
    
    Built for x86_64-little_endian-lp64, running on x86_64
    Qt Version 5.15.6
    SQLCipher Version 4.5.2 community (based on SQLite 3.39.2).
    

    Installed via pacman: https://archlinux.org/packages/community/x86_64/sqlitebrowser/

  25. chrisjlocke commented on Apr 17, 2023

    @chrisjlocke
    MemberAuthor

    Then, run following:
    BEGIN TRANSACTION;

    The process of using the SQL tabs, and the purpose of the 'Write changes' button is it is already using transactions.
    By adding your own, you're erasing the history and journal needed for the transactions to occur .. so when you press 'Write Changes' you've already committed, so the 'no such savepoint' is going to fail .. as you've wiped the journal.

    There is no need to use transactions in the 'Execute SQL' tabs. That is the point of the 'Write changes' button. Perform the SQL. If you want to commit, click the 'write changes'. If you don't, click 'Discard'.
    This is expected behaviour.

  26. vilhok commented on Apr 18, 2023

    @vilhok

    This is expected behaviour.

    Thank's for the reply, I'm sorry for misunderstanding this. I can see now that this is documented here in the wiki .

    On the other hand, using commands such as ROLLBACK and COMMIT still works (at least during specific states) but the UI does not reflect this. For example BEING TRANSACTION ; just prints Execution finished without errors. and if after that I do an INSERT and then ROLLBACK it works the first time. The problem is that if I run the same SQL tab again, I start getting errors about no active transactions.

    I feel like this is not immediately obvious to the user. I think like it should warn the user about trying to do transactions on their own, or at least it should not end up in such inconsistent state. Another example:

    INSERT INTO some_table VALUES(123,345);
    ROLLBACK;

    This makes the insert and then discards the changes.

    Run that again, the rollback now fails with an error message about transaction being active, even BEGIN TRANSACTION now fails. I can also click "Revert Changes" but that does not actually revert the latest change.

    The Wiki is clear about this and warns about trying to do nested transactions, but I'd consider if it was worth to add a feature that disables this behavior and hands over the control to the user completely. Alternate solution would be to give a specific warning when trying to do transactions manually and yet another solution would be to bind the button actions/states to the begin and rollback -commands. I might want to open a separate issue about this, unless this idea has already been discarded before.

  27. chrisjlocke commented on Apr 19, 2023

    @chrisjlocke
    MemberAuthor

    Its a fine balance between having instructions not to do something, and trying not to bloat the software with code to stop the user doing something.
    The code to do what you're asking isn't impossible, but poses risks without a lot of testing - switching tabs may then not work, or the program would have to monitor the state of every tab, etc.

    Do-able, but we don't have a team of 90 programmers all itching for something to do.

    Here in the UK, we have tried to stop kids sticking forks in the plug sockets. We have done a lot towards that, and could stick a wire cage around each socket, but then they'd pour water in.
    Point being, we could add a bunch of code to do all that, then someone will find another way of breaking it.
    Sometimes, a list of 'known issues' is at least recognising the problem and a way of stopping people losing forks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bugs or reports that are very likely to be bugs.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions