Skip to content

Conversation

@kevinlang
Copy link
Member

I ran mix test a bunch locally to make sure there are no intermittent failures, and did not hit any (but no guarantees).

I hit an issue with rollback that was fixed by commenting out some extra conditions in a case, as you can see. Obviously not the long term fix, so feel free to adjust accordingly. Some issue with nested transactions, maybe.

end)
|> TestRepo.transaction()
end
# "cannot open savepoint - SQL statements in progress"
Copy link
Member

@warmwaffles warmwaffles Mar 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure it is prepared statements or that we aren't releasing a save point correctly? I can dig more into this once we get this merged. Just want your thoughts.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a log in handle_transaction to output the SQL and I couldn't see any case where we created a save point but did not release it. This error seems to be pretty rare, as I couldn't find anything via a search about it. If you look at sqlite.c:88847 it mentions something about "active write statements", hence my hypothesis.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I'll see if I can reliably recreate the issue and dig around a bit

end)
|> TestRepo.transaction()
end
# "cannot open savepoint - SQL statements in progress"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I'll see if I can reliably recreate the issue and dig around a bit

@warmwaffles warmwaffles merged commit 2481187 into elixir-sqlite:main Mar 8, 2021
@warmwaffles warmwaffles mentioned this pull request Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants