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

Pitfalls of using Petapoco async api inside using. #724

Open
mercurial-moon opened this issue Sep 24, 2024 · 0 comments
Open

Pitfalls of using Petapoco async api inside using. #724

mercurial-moon opened this issue Sep 24, 2024 · 0 comments

Comments

@mercurial-moon
Copy link

Are there any pitfalls of using PetaPoco async api with a using statement.

My current pattern is

using (var db = new Database(connStr, "Npgsql")){
await db.BeginTransactionAsync();

// some select statements using await
// some update statements using await

await db.CompleteTransactionAsync();
}

I see that when i run this code, i find certain transactions are not committed while some are, no exceptions are thrown... so i'm not really sure where things are going wrong.
To further add to the above i'm running multiple instances of the above app, on different machines and they all are talking to one db server.
When i step into the above using block and step over the update statement i see that the return shows the number 1 which means that 1 row was edited. But when I check the db the changes are not reflected.

@mercurial-moon mercurial-moon changed the title Pitfalls of using Petopoco async api inside using. Pitfalls of using Petapoco async api inside using. Sep 24, 2024
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