Skip to content

Runtime: set transaction_started = 0 after db COMMIT#274

Open
buggymcbugfix wants to merge 2 commits into
urweb:masterfrom
buggymcbugfix:end_txn_post_commit
Open

Runtime: set transaction_started = 0 after db COMMIT#274
buggymcbugfix wants to merge 2 commits into
urweb:masterfrom
buggymcbugfix:end_txn_post_commit

Conversation

@buggymcbugfix

Copy link
Copy Markdown

This fixes #273 for me.

I am not very familiar with ur/web internals and I suppose I was lucky with this fix working, because after digging deeper, I am quite confused as to how a commit-phase error triggers ctx->app->db_rollback (which causes the crash described in #273)

The only places I can see that run ctx->app->db_rollback are uw_expunge and uw_rollback, but I don't see how either of these would be reached at this point here: https://github.com/urweb/urweb/blob/master/src/c/urweb.c#L3764-L3785

Without this, when there is an error during the commit phase of a NULL
rollback transactional, we get a hard error because the runtime issues
a ROLLBACK command to the database, despite there being no active
transaction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C FFI: error in NULL rollback transactional triggers incorrect db ROLLBACK

1 participant