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

Doc error over transaction syntax #224

Open
hongyuan1306 opened this issue Jul 2, 2020 · 2 comments
Open

Doc error over transaction syntax #224

hongyuan1306 opened this issue Jul 2, 2020 · 2 comments

Comments

@hongyuan1306
Copy link

@hongyuan1306 hongyuan1306 commented Jul 2, 2020

In the doc section over transaction, for a lower-level transaction API, the following example is given:

transaction = await database.transaction()
try:
    ...
except:
    transaction.rollback()
else:
    transaction.commit()

Actually the rollback and commit are all async methods. So they shall be all awaited.

@pumpkiny9120
Copy link

@pumpkiny9120 pumpkiny9120 commented Sep 18, 2020

Hi @hongyuan1306 , I also noticed the same after trying the transactions from the documentation. Did it work for you after adding await? For some reason it's still auto-committing for me, and I don't know how to turn auto-commit off...

@hongyuan1306
Copy link
Author

@hongyuan1306 hongyuan1306 commented Sep 18, 2020

@pumpkiny9120 Yes, it works with the postgresql backend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants