Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race conditions accidentally create nested transactions (and fail) #685

Open
fdietze opened this issue Jul 27, 2022 · 0 comments
Open

Race conditions accidentally create nested transactions (and fail) #685

fdietze opened this issue Jul 27, 2022 · 0 comments

Comments

@fdietze
Copy link
Contributor

fdietze commented Jul 27, 2022

(discord: https://discord.com/channels/632277896739946517/839844929877704785/999575181624352839)

Let's say, I have a function that does some queries in a transaction. Now, I connect to postgres with only a single connection. Then, I'm executing the function 10 times in parallel. What will happen?

Ideally, there is a Semaphore that serializes the execution of these 10 function calls.

But what's actually happening is, that you'll get a nested transaction error from skunk.

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

No branches or pull requests

1 participant