Skip to content

setAutoCommit(false) sets the flag before BEGIN succeeds #108

Closed

Description

@magnusp

LibsqlConnection.setAutoCommit(false) assigns this.autoCommit = false and then calls beginTransaction(). If BEGIN throws, the connection stays at autoCommit == false with baton == null.

After the failure:

  • getAutoCommit() returns false.
  • commit() throws "No transaction is active".
  • The next statement silently begins a transaction.

#64 set out to remove this kind of state drift after a failure.

Expected:

  • Assign the flag after beginTransaction() succeeds, or restore the previous value in a catch block.
  • Add a test with a failing BEGIN.

Activity

  1. added
    bugSomething isn't working
    P2Normal priority: edge case, feature gap, or test/process improvement
    on Oct 22, 2026
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

    P2Normal priority: edge case, feature gap, or test/process improvementbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions