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

docs: transaction doesn't have property succeeded #781

Closed
pdknsk opened this issue Mar 30, 2015 · 2 comments · Fixed by #784
Closed

docs: transaction doesn't have property succeeded #781

pdknsk opened this issue Mar 30, 2015 · 2 comments · Fixed by #784
Assignees
Labels
api: datastore Issues related to the Datastore API.

Comments

@pdknsk
Copy link

pdknsk commented Mar 30, 2015

The docs still mention the succeeded property on transactions run with with even though it has been removed in ed0762b. It's not clear to me how to check for a successful transaction now. I suspect it throws an exception otherwise, which mirrors ndb behaviour, but I still check for _status == 3 just in case.

@dhermes dhermes added the api: datastore Issues related to the Datastore API. label Mar 31, 2015
@dhermes dhermes added this to the Datastore Future milestone Mar 31, 2015
@dhermes dhermes added the docs label Mar 31, 2015
@dhermes
Copy link
Contributor

dhermes commented Mar 31, 2015

@pdknsk Thanks for pointing it out. I was hoping it was in an old docs build, but I confirmed it is present in HEAD.


As for how you can check it going forward, see my comment in the PR.

The context manager doesn't swallow exceptions. So __exit__ing the context manager without a failure is equivalent to success.

The only reason we kept the _status around is so that a Transaction object is "tombstoned" after one use. In other words, so people can't mistakenly try to re-enter a transaction.

@dhermes dhermes self-assigned this Mar 31, 2015
dhermes added a commit to dhermes/google-cloud-python that referenced this issue Mar 31, 2015
@dhermes
Copy link
Contributor

dhermes commented Mar 31, 2015

@pdknsk I'm going to close this when #784 is merged, let me know if you want to keep this open for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants