Skip to content

After an exception during transaction commit the changed date from transaction is still visible to the current connection #236

Open
@irgendwienet

Description

@irgendwienet

I'm using FK constrains with the SQLite option DEFERRABLE INITIALLY DEFERRED (see https://www.sqlite.org/foreignkeys.html#fk_deferred). So if the FK is violated in a transaction an exception is only thrown on commit not on the actual SQL statement violating this constraint.

When catching this exception and querying the database it looks (for the current connection) as if my FK-violating operations were written to database. So this connection is somewhat dirty.

One solution would be to do a rollback() in my catch block but the SQLite.net connection won't actually execute this rollback on the database since for SQLite.net there is no active transaction.

After some more testing I will provide a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions