Skip to content

last_insert_rowid() in auto-commit reads a fresh Hrana session #83

Closed

Description

@magnusp

Found while landing #39. In auto-commit mode, a direct SELECT last_insert_rowid() runs on a fresh one-shot Hrana stream and returns 0, while xerial 3.53.4.0 returns the connection's last insert rowid.

#39 avoids depending on that query by reading last_insert_rowid from the Hrana insert result, but the direct-query behavior still differs. A fix needs connection-scoped execution for session-state functions in auto-commit, verified against live sqld.

Activity

  1. added
    bugSomething isn't working
    P1High priority: significant correctness or compatibility gap
    on Oct 21, 2026
  2. magnusp commented on Oct 30, 2026

    @magnusp
    OwnerAuthor

    Hibernate's SQLite GenerationType.IDENTITY also reads the identity with a separate select last_insert_rowid(), so it depends on the same session-state behavior. The new Hibernate integration suite (#264) keeps auto-commit disabled and documents this dependency rather than duplicating the issue.

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

    P1High priority: significant correctness or compatibility gapbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions